MetaGraphs Functions

MetaGraphs

Metadata for graphs is stored as a series of named key-value pairs, with the key being an instance of type Symbol and the value being any type. The following methods are available for MetaGraphs:

clear_props!(g)
clear_props!(g, v)
clear_props!(g, e)
clear_props!(g, s, d)

Remove all defined properties from graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d).

source
defaultweight!(g, weight)

Set the default weight for metagraph g

source
defaultweight(g)

Return the default weight for metagraph g.

source
filter_edges(g, prop[, val])
filter_edges(g, fn)

Return an iterator to all edges that have property prop defined (optionally as val), or where function fn returns true only for edges that should be included in the iterator.

fn should be of the form

fn(g::AbstractMetaGraph{T}, e::SimpleEdge{T})::Boolean

where e is replaced with the edge being evaluated.

source
filter_vertices(g, prop[, val])
filter_vertices(g, fn)

Return an iterator to all vertices that have property prop defined (optionally as val), or where function fn returns true only for vertices that should be included in the iterator.

fn should be of the form

fn(g::AbstractMetaGraph, v::Integer)::Boolean

where v is replaced with the vertex being evaluated.

source
get_prop(g, prop)
get_prop(g, v, prop)
get_prop(g, e, prop)
get_prop(g, s, d, prop)

Return the property prop defined for graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d). If property is not defined, return an error.

source
has_prop(g, prop)
has_prop(g, v, prop)
has_prop(g, e, prop)
has_prop(g, s, d, prop)

Return true if the property prop is defined for graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d).

source
MetaGraphs.propsMethod.
props(g)
props(g, v)
props(g, e)
props(g, s, d)

Return a dictionary of all metadata from graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d).

source
rem_prop!(g, prop)
rem_prop!(g, v, prop)
rem_prop!(g, e, prop)
rem_prop!(g, s, d, prop)

Remove property prop from graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d). If property does not exist, will not do anything.

source
set_prop!(g, prop, val)
set_prop!(g, v, prop, val)
set_prop!(g, e, prop, val)
set_prop!(g, s, d, prop, val)

Set (replace) property prop with value val in graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d).

source
set_props!(g, dict)
set_props!(g, v, dict)
set_props!(g, e, dict)
set_props!(g, s, d, dict)

Bulk set (merge) properties contained in dict with graph g, vertex v, or edge e (optionally referenced by source vertex s and destination vertex d).

source
weightfield!(g, prop)

Set the field that contains weight information to prop.

source
weightfield(g)

Return the field that contains weight information for metagraph g.

source