Welcome to Graph’s documentation!

Graph Class

graph.Graph([edges, nodes]) Creates a graph with the specified vertices and edges

Methods

Construction Methods

graph.Graph.add_edges(edges) Adds edges to the graph.
graph.Graph.add_nodes(nodes) Adds nodes to the graph.
graph.Graph.new_projection(edge_map, node_map) Construct a new graph.Graph whose nodes are the values returned by applying the function node_map(node) -> new_node to each node; and whose edges are the values returned by applying the function edge_map(src_node,dst_node,edge_obj) -> new_edge_obj to each edge triple.
graph.Graph.new_subgraph([edge_pred, node_pred]) Returns the maximal subgraph for which all nodes satisfy the node predicate and all edges satisfy the edge predicate.

Local Graph Methods

graph.Graph.send_collect(emmiter, collector) Request each edge triple to emmit messages via the function emitter which will be delivered to its source and destination node where they will be processed by the function collector.
graph.Graph.update_edges(updater) Apply the function updater(src_node,dst_node,edge_obj) to each edge triple, it should treat the source and destination objects, src_node and dst_node, as constant inputs.
graph.Graph.update_nodes(updater) Apply the function updater(node) to each node.

Query Methods

graph.Graph.nodes() Returns a set-like object containing the nodes in the graph.
graph.Graph.find(motif) Returns all structure patterns found in the graph which match the given motif.

Additional Classes and Algorithms

graph.algorithms.GraphLabel(name, \*\*attrs) A dict-like convenience wrapper object for graph nodes and edge labels.
graph.algorithms.out_degree(g) Computes the out degree of each node.
graph.algorithms.page_rank(g, reset_prob[, ...]) Computes the PageRank of each node in g and stores it in node[‘page_rank’].
graph.algorithms.connected_comp(g) Computes the connected components of the graph.

Indices and tables