API reference

MetaDataGraphs.AbstractDataGraphType
AbstractDataGraph{T,VL,VD,ED,GD} <: AbstractGraph{T}

General template for graphs with metadata.

  • T<:Integer is the type of vertices
  • VL is the type of vertex labels (cannot be a subtype of Integer)
  • VD is the type of vertex data objects
  • ED is the type of edge data objects
  • GD is the type of the graph data object
source
MetaDataGraphs.DataDiGraphType
DataDiGraph{T,VL,VD,ED,GD} <: AbstractDataGraph{T}

Structure for graphs with metadata based on adjacency list storage.

Fields

  • ne::Int: number of edges
  • fadjlist::Vector{Vector{Int}}: forward adjacency lists
  • badjlist::Vector{Vector{Int}}: backward adjacency lists
  • labels::Vector{VL}: list of vertex labels
  • vertices::Dict{VL,T}: dictionary mapping each vertex label to the associated integer index v
  • vertex_data::Vector{VD}: list of vertex data objects, indexed by integers v
  • edge_data::Vector{Vector{ED}}: list of edge data objects, indexed by s first and d_index second, where d_index is the rank of d among the outneighbors of s
  • graph_data::GD: single graph data object
source
Base.haskeyMethod
haskey(g, label)

Check whether a vertex with label label exists.

source
Graphs.SimpleGraphs.add_edge!Method
add_edge!(g, label_s, label_d, data)

Add an edge between the vertices with labels label_s and label_d, along with the associated data.

source
Graphs.has_edgeMethod
has_edge(g, label_s, label_d)

Check whether an edge exists between the vertices with labels label_s and label_d.

source
Graphs.weightsMethod
weights(g)

Compute the edge weights for an AbstractDataGraph.

  • If the edge data is of type ED = Nothing, return a lazy matrix full of ones.
  • If the edge data is of type ED <: Real, fill a sparse matrix with it.
  • If the edge data is of another type ED, try to use the attribute edge_data.weight for each edge.
source
MetaDataGraphs.get_dataMethod
get_data(g, label_s, label_d)

Retrieve edge-level metadata for the edge between the vertices with labels label_s and label_d.

source
MetaDataGraphs.set_data!Method
set_data!(g, label_s, label_d, data)

Set edge-level metadata to value data for the edge between the vertices with labels label_s and label_d.

source