Skip to content

Commit 7f8de83

Browse files
author
Matthias Koeppe
committed
sage.graphs: More # optional
1 parent f2f5863 commit 7f8de83

23 files changed

+476
-429
lines changed

src/sage/graphs/base/c_graph.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4548,7 +4548,7 @@ cdef class CGraphBackend(GenericGraphBackend):
45484548
At first, the following graph is acyclic::
45494549
45504550
sage: D = DiGraph({ 0:[1,2,3], 4:[2,5], 1:[8], 2:[7], 3:[7], 5:[6,7], 7:[8], 6:[9], 8:[10], 9:[10] })
4551-
sage: D.plot(layout='circular').show()
4551+
sage: D.plot(layout='circular').show() # optional - sage.plot
45524552
sage: D.is_directed_acyclic()
45534553
True
45544554

src/sage/graphs/bipartite_graph.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class BipartiteGraph(Graph):
158158
sage: B = BipartiteGraph(P, partition, check=False)
159159
sage: B.left
160160
{0, 1, 2, 3, 4}
161-
sage: B.show()
161+
sage: B.show() # optional - sage.plot
162162
163163
::
164164
@@ -304,14 +304,14 @@ class BipartiteGraph(Graph):
304304
sage: B = BipartiteGraph('F?^T_\n', partition=[[0, 1, 2], [3, 4, 5, 6]], check=False)
305305
sage: B.left
306306
{0, 1, 2}
307-
sage: B.show()
307+
sage: B.show() # optional - sage.plot
308308
309309
#. From a NetworkX bipartite graph::
310310
311-
sage: import networkx # optional - networkx
312-
sage: G = graphs.OctahedralGraph() # optional - networkx
313-
sage: N = networkx.make_clique_bipartite(G.networkx_graph()) # optional - networkx
314-
sage: B = BipartiteGraph(N) # optional - networkx
311+
sage: import networkx # optional - networkx
312+
sage: G = graphs.OctahedralGraph() # optional - networkx
313+
sage: N = networkx.make_clique_bipartite(G.networkx_graph()) # optional - networkx
314+
sage: B = BipartiteGraph(N) # optional - networkx
315315
316316
TESTS:
317317
@@ -1464,7 +1464,7 @@ def plot(self, *args, **kwds):
14641464
EXAMPLES::
14651465
14661466
sage: B = BipartiteGraph(graphs.CycleGraph(20))
1467-
sage: B.plot()
1467+
sage: B.plot() # optional - sage.plot
14681468
Graphics object consisting of 41 graphics primitives
14691469
"""
14701470
if "pos" not in kwds:

src/sage/graphs/cliquer.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def all_max_clique(graph):
115115
[2, 6], [2, 8], [3, 4], [3, 7], [3, 9], [4, 5], [4, 8], [5, 10],
116116
[5, 11], [6, 10], [6, 11], [7, 8], [7, 11], [8, 10], [9, 10], [9, 11]]
117117
sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
118-
sage: G.show(figsize=[2,2])
118+
sage: G.show(figsize=[2,2]) # optional - sage.plot
119119
sage: G.cliques_maximum()
120120
[[0, 1, 2], [0, 1, 3]]
121121
sage: C = graphs.PetersenGraph()
@@ -302,7 +302,7 @@ def clique_number(graph):
302302
sage: C.clique_number()
303303
4
304304
sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
305-
sage: G.show(figsize=[2,2])
305+
sage: G.show(figsize=[2,2]) # optional - sage.plot
306306
sage: G.clique_number()
307307
3
308308

src/sage/graphs/comparability.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def is_permutation(g, algorithm="greedy", certificate=False, check=True,
642642
sage: p1 = Permutation([nn+1 for nn in perm[0]])
643643
sage: p2 = Permutation([nn+1 for nn in perm[1]])
644644
sage: p = p2 * p1.inverse()
645-
sage: p.show(representation = "braid")
645+
sage: p.show(representation="braid") # optional - sage.plot
646646

647647
TESTS:
648648

src/sage/graphs/connectivity.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ def connected_components_subgraphs(G):
215215
sage: from sage.graphs.connectivity import connected_components_subgraphs
216216
sage: G = Graph({0: [1, 3], 1: [2], 2: [3], 4: [5, 6], 5: [6]})
217217
sage: L = connected_components_subgraphs(G)
218-
sage: graphs_list.show_graphs(L)
218+
sage: graphs_list.show_graphs(L) # optional - sage.plot
219219
sage: D = DiGraph({0: [1, 3], 1: [2], 2: [3], 4: [5, 6], 5: [6]})
220220
sage: L = connected_components_subgraphs(D)
221-
sage: graphs_list.show_graphs(L)
221+
sage: graphs_list.show_graphs(L) # optional - sage.plot
222222
sage: L = D.connected_components_subgraphs()
223-
sage: graphs_list.show_graphs(L)
223+
sage: graphs_list.show_graphs(L) # optional - sage.plot
224224
225225
TESTS:
226226

src/sage/graphs/digraph.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -951,7 +951,7 @@ def is_directed_acyclic(self, certificate=False):
951951
At first, the following graph is acyclic::
952952
953953
sage: D = DiGraph({0:[1, 2, 3], 4:[2, 5], 1:[8], 2:[7], 3:[7], 5:[6,7], 7:[8], 6:[9], 8:[10], 9:[10]})
954-
sage: D.plot(layout='circular').show()
954+
sage: D.plot(layout='circular').show() # optional - sage.plot
955955
sage: D.is_directed_acyclic()
956956
True
957957
@@ -3140,7 +3140,7 @@ def topological_sort(self, implementation="default"):
31403140
31413141
sage: D = DiGraph({0: [1, 2, 3], 4: [2, 5], 1: [8], 2: [7], 3: [7],
31423142
....: 5: [6, 7], 7: [8], 6: [9], 8: [10], 9: [10]})
3143-
sage: D.plot(layout='circular').show()
3143+
sage: D.plot(layout='circular').show() # optional - sage.plot
31443144
sage: D.topological_sort()
31453145
[4, 5, 6, 9, 0, 1, 2, 3, 7, 8, 10]
31463146
@@ -3220,7 +3220,7 @@ def topological_sort_generator(self):
32203220
EXAMPLES::
32213221
32223222
sage: D = DiGraph({0: [1, 2], 1: [3], 2: [3, 4]})
3223-
sage: D.plot(layout='circular').show()
3223+
sage: D.plot(layout='circular').show() # optional - sage.plot
32243224
sage: list(D.topological_sort_generator())
32253225
[[0, 1, 2, 3, 4], [0, 2, 1, 3, 4], [0, 2, 1, 4, 3], [0, 2, 4, 1, 3], [0, 1, 2, 4, 3]]
32263226

0 commit comments

Comments
 (0)