Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Examples of graphs """ #***************************************************************************** # Copyright (C) 2015 Travis Scrimshaw <tscrim at ucdavis.edu> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #******************************************************************************
r""" An example of a graph: the cycle of length `n`.
This class illustrates a minimal implementation of a graph.
EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example(); C An example of a graph: the 5-cycle
sage: C.category() Category of graphs
We conclude by running systematic tests on this graph::
sage: TestSuite(C).run() """ r""" EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example(6); C An example of a graph: the 6-cycle
TESTS::
sage: TestSuite(C).run() """
r""" TESTS::
sage: from sage.categories.graphs import Graphs sage: Graphs().example() An example of a graph: the 5-cycle """
r""" Return an element of the graph, as per :meth:`Sets.ParentMethods.an_element`.
EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example() sage: C.an_element() 0 """
""" Return the vertices of ``self``.
EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example() sage: C.vertices() [0, 1, 2, 3, 4] """
""" Return the edges of ``self``.
EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example() sage: C.edges() [(0, 1), (1, 2), (2, 3), (3, 4), (4, 0)] """
""" Return the dimension of ``self``.
EXAMPLES::
sage: from sage.categories.graphs import Graphs sage: C = Graphs().example() sage: e = C.edges()[0] sage: e.dimension() 2 sage: v = C.vertices()[0] sage: v.dimension() 1 """
|