add_props_to_graph

compute.add_props_to_graph(
    G,
    node_props=None,
    node_prop_names=None,
    edge_props=None,
    edge_prop_names=None,
)

Add node and edge property dicts to a graph.

The function takes in a graph, and a list of node properties and edge properties, and adds them to the graph as node and edge attributes.

Parameters

Name Type Description Default
G the graph required
node_props a list of lists, where each list contains the node properties for a given node property None
node_prop_names list of names of node properties None
edge_props a list of lists, where each list contains the edge properties for a given edge property None
edge_prop_names list of strings, names of edge properties None

Returns

Name Type Description
A graph with the node and edge properties added to it.