09.02.2015 Views

Sage Reference Manual: Graph Theory - Mirrors

Sage Reference Manual: Graph Theory - Mirrors

Sage Reference Manual: Graph Theory - Mirrors

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER<br />

ONE<br />

GRAPH OBJECTS AND METHODS<br />

1.1 Generic graphs<br />

This module implements the base class for graphs and digraphs, and methods that can be applied on both. Here is<br />

what it can do:<br />

Basic <strong>Graph</strong> operations:<br />

networkx_graph()<br />

to_dictionary()<br />

copy()<br />

adjacency_matrix()<br />

incidence_matrix()<br />

distance_matrix()<br />

weighted_adjacency_matrix()<br />

kirchhoff_matrix()<br />

get_boundary()<br />

set_boundary()<br />

has_loops()<br />

allows_loops()<br />

allow_loops()<br />

loops()<br />

has_multiple_edges()<br />

allows_multiple_edges()<br />

allow_multiple_edges()<br />

multiple_edges()<br />

name()<br />

weighted()<br />

antisymmetric()<br />

density()<br />

order()<br />

size()<br />

add_vertex()<br />

add_vertices()<br />

delete_vertex()<br />

delete_vertices()<br />

has_vertex()<br />

random_vertex()<br />

Creates a new NetworkX graph from the <strong>Sage</strong> graph<br />

Creates a dictionary encoding the graph.<br />

Return a copy of the graph.<br />

Returns the adjacency matrix of the (di)graph.<br />

Returns an incidence matrix of the (di)graph<br />

Returns the distance matrix of the (strongly) connected (di)graph<br />

Returns the weighted adjacency matrix of the graph<br />

Returns the Kirchhoff matrix (a.k.a. the Laplacian) of the graph.<br />

Returns the boundary of the (di)graph.<br />

Sets the boundary of the (di)graph.<br />

Returns whether there are loops in the (di)graph.<br />

Returns whether loops are permitted in the (di)graph.<br />

Changes whether loops are permitted in the (di)graph.<br />

Returns any loops in the (di)graph.<br />

Returns whether there are multiple edges in the (di)graph.<br />

Returns whether multiple edges are permitted in the (di)graph.<br />

Changes whether multiple edges are permitted in the (di)graph.<br />

Returns any multiple edges in the (di)graph.<br />

Returns or sets the graph’s name.<br />

Whether the (di)graph is to be considered as a weighted (di)graph.<br />

Tests whether the graph is antisymmetric<br />

Returns the density<br />

Returns the number of vertices.<br />

Returns the number of edges.<br />

Creates an isolated vertex.<br />

Add vertices to the (di)graph from an iterable container<br />

Deletes a vertex, removing all incident edges.<br />

Remove vertices from the (di)graph taken from an iterable container of vertices.<br />

Return True if vertex is one of the vertices of this graph.<br />

Returns a random vertex of self.<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!