dodiscover.Graph#

class dodiscover.Graph(*args, **kwargs)[source]#

Protocol for graphs to work with dodiscover algorithms.

Attributes:
nodes

Return an iterable over nodes in graph.

Methods

add_edge(u, v[, edge_type])

Add an edge to the graph.

add_node(node_for_adding, **attr)

Add a node to the graph.

copy()

Create a copy of the graph.

edges([data])

Return an iterable over edge tuples in graph.

has_edge(u, v[, edge_type])

Check if graph has an edge for a specific edge type.

neighbors(node)

Iterate over all nodes that have any edge connection with 'node'.

remove_edge(u, v[, edge_type])

Remove an edge from the graph.

remove_edges_from(edges)

Remove a set of edges from the graph.

remove_node(u)

Remove a node from the graph.

subgraph(nodes)

Get subgraph based on nodes.

to_undirected()

Convert a graph to a fully undirected networkx graph.

add_edge(u, v, edge_type='all')[source]#

Add an edge to the graph.

add_node(node_for_adding, **attr)[source]#

Add a node to the graph.

copy()[source]#

Create a copy of the graph.

edges(data=None)[source]#

Return an iterable over edge tuples in graph.

has_edge(u, v, edge_type='any')[source]#

Check if graph has an edge for a specific edge type.

neighbors(node)[source]#

Iterate over all nodes that have any edge connection with ‘node’.

property nodes#

Return an iterable over nodes in graph.

remove_edge(u, v, edge_type='all')[source]#

Remove an edge from the graph.

remove_edges_from(edges)[source]#

Remove a set of edges from the graph.

remove_node(u)[source]#

Remove a node from the graph.

subgraph(nodes)[source]#

Get subgraph based on nodes.

to_undirected()[source]#

Convert a graph to a fully undirected networkx graph.

All nodes are connected by an undirected edge if there are any edges between the two.