Graph#

Module provides basic Graph classes.

class AnnotatedGraph(name=None, n_vertices=None, edges=None, directed=False, vertex_coordinates=None, vertex_radii=None, edge_coordinates=None, edge_radii=None, edge_geometries=None, shape=None, vertex_labels=None, edge_labels=None, annotation=None)[source]#

Bases: GeometricGraph

Base class for graphs whose vertices are embedded in an Eucledian space and have an annotation.

edge_annotation()[source]#
set_edge_annotation(value)[source]#
set_vertex_annotation(value)[source]#
vertex_annotation()[source]#
property annotation#
class GeometricGraph(name=None, n_vertices=None, edges=None, directed=False, vertex_coordinates=None, vertex_radii=None, edge_coordinates=None, edge_radii=None, edge_geometries=None, shape=None)[source]#

Bases: Graph

Base class for graphs whose vertices are embedded in an Eucledian space.

edge_coordinates(edge=None)[source]#
edge_coordinates_from_vertex_coordinates()[source]#
edge_geometry(*args, **kwargs)[source]#
edge_radii(edge=None)[source]#
edge_radii_from_vertex_radii()[source]#
edge_vectors(normalize=False)[source]#
expand_edge_geometry()[source]#
reduce_edge_geometry()[source]#
set_edge_coordinates(coordinates, axis=None, edge=None)[source]#
set_edge_geometry(*args, **kwargs)[source]#
set_edge_radii(edge=None)[source]#
set_vertex_coordinates(coordinates, axis=None, vertex=None)[source]#
set_vertex_radii(radius, vertex=None)[source]#
vertex_coordinates(axis=None, vertex=None)[source]#
vertex_radii(vertex=None)[source]#
property edge_geometry_type#
property has_edge_geometry#
property ndim#
property shape#

The shape of the underlying space in which the graph is embedded.

class Graph(name=None, n_vertices=None, edges=None, directed=None)[source]#

Bases: object

Abstract base Graph class.

All graph interfaces should inherit from the class.

add_edge(edge)[source]#
add_edge_property(name, source, dtype=None)[source]#
add_vertex(n_vertices=None, index=None, vertex=None)[source]#
add_vertex_property(name, source, dtype=None)[source]#
edge(edge)[source]#
edge_connectivity()[source]#
edge_properties()[source]#
edge_property(name)[source]#
load(filename)[source]#
remove_edge(edge)[source]#
remove_edge_property(name)[source]#
remove_vertex(index=None, vertex=None)[source]#
remove_vertex_property(name)[source]#
save(filename)[source]#
set_edge_property(name, source)[source]#
set_vertex_property(name, source)[source]#
vertex(index)[source]#
vertex_degree(index)[source]#
vertex_degrees()[source]#
vertex_in_degree(index)[source]#
vertex_in_degrees()[source]#
vertex_out_degree(index)[source]#
vertex_out_degrees()[source]#
vertex_properties()[source]#
vertex_property(name, index=None)[source]#
property directed#
property edges#
property n_edges#

Number of edges in the graph.

property n_vertices#

Number of vertices in the graph.

property name#
property vertices#
load(filename)[source]#
save(filename, graph)[source]#