# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1272441720 -7200
# Node ID 6ff8b2af66e4189292d67f9e0dbb02197c9d749f
# Parent eab8e5597dd105ff5ae2d8ec0df2889d89dcb5fc
added fixes
diff -r eab8e5597dd1 -r 6ff8b2af66e4 sage/graphs/digraph.py
a
|
b
|
|
18 | 18 | Directed graph. |
19 | 19 | |
20 | 20 | A digraph or directed graph is a set of vertices connected by oriented |
21 | | edges (cf. http://en.wikipedia.org/wiki/Digraph_%28mathematics%29 ). |
| 21 | edges. |
| 22 | |
| 23 | `Wikipedia article on digraphs |
| 24 | <http://en.wikipedia.org/wiki/Digraph_%28mathematics%29>`_ |
22 | 25 | |
23 | 26 | One can very easily create a directed graph in Sage by typing:: |
24 | 27 | |
… |
… |
|
1099 | 1102 | Equivalently, a minimum feedback arc set of a DiGraph is a set |
1100 | 1103 | `S` of arcs such that the digraph `G-S` is acyclic. |
1101 | 1104 | |
1102 | | For more informations, see |
1103 | | ( http://en.wikipedia.org/wiki/Feedback_arc_set ) |
| 1105 | `Wikipedia article on Feedback arc sets |
| 1106 | <http://en.wikipedia.org/wiki/Feedback_arc_set>`_. |
1104 | 1107 | |
1105 | 1108 | INPUT : |
1106 | 1109 | |
… |
… |
|
1208 | 1211 | Equivalently, a minimum feedback vertex set of a DiGraph is a set |
1209 | 1212 | `S` of vertices such that the digraph `G-S` is acyclic. |
1210 | 1213 | |
1211 | | For more informations, see |
1212 | | ( http://en.wikipedia.org/wiki/Feedback_vertex_set ) |
| 1214 | `Wikipedia article on Feedback vertex sets |
| 1215 | <http://en.wikipedia.org/wiki/Feedback_vertex_set>`_. |
1213 | 1216 | |
1214 | 1217 | INPUT : |
1215 | 1218 | |
diff -r eab8e5597dd1 -r 6ff8b2af66e4 sage/graphs/digraph_generators.py
a
|
b
|
|
287 | 287 | In this digraph, there is an arc `w_1w_2` if `w_2` |
288 | 288 | can be obtained from `w_1` by removing the leftmost |
289 | 289 | letter and adding a new letter at its right end. |
290 | | ( more information on this page : |
291 | | http://en.wikipedia.org/wiki/De_Bruijn_graph ) |
| 290 | |
| 291 | `Wikipedia article on the De Bruijn graph |
| 292 | <http://en.wikipedia.org/wiki/De_Bruijn_graph>`_ |
292 | 293 | |
293 | 294 | INPUT: |
294 | 295 | |
diff -r eab8e5597dd1 -r 6ff8b2af66e4 sage/graphs/generic_graph.py
a
|
b
|
|
3028 | 3028 | A minimum edge cut between two vertices `s` and `t` of self |
3029 | 3029 | is a set `A` of edges of minimum weight such that the graph |
3030 | 3030 | obtained by removing `A` from self is disconnected. |
3031 | | ( cf. http://en.wikipedia.org/wiki/Cut_%28graph_theory%29 ) |
| 3031 | |
| 3032 | `Wikipedia article on cuts |
| 3033 | <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_. |
3032 | 3034 | |
3033 | 3035 | INPUT: |
3034 | 3036 | |
… |
… |
|
3153 | 3155 | A vertex cut between two non adjacent vertices is a set `U` |
3154 | 3156 | of vertices of self such that the graph obtained by removing |
3155 | 3157 | `U` from self is disconnected. |
3156 | | ( cf. http://en.wikipedia.org/wiki/Cut_%28graph_theory%29 ) |
| 3158 | |
| 3159 | `Wikipedia article on cuts |
| 3160 | <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_ |
3157 | 3161 | |
3158 | 3162 | |
3159 | 3163 | INPUT: |
… |
… |
|
3265 | 3269 | vertices such that each edge is incident to at least |
3266 | 3270 | one element of `S`, and such that `S` is of minimum |
3267 | 3271 | cardinality. |
3268 | | ( cf. http://en.wikipedia.org/wiki/Vertex_cover ) |
| 3272 | |
| 3273 | `Wikipedia article on vertex cover |
| 3274 | <http://en.wikipedia.org/wiki/Vertex_cover>`_. |
3269 | 3275 | |
3270 | 3276 | Equivalently, a vertex cover is defined as the |
3271 | 3277 | complement of an independent set. |
… |
… |
|
3353 | 3359 | Equivalently, a minimum feedback arc set of a DiGraph is a set |
3354 | 3360 | `S` of arcs such that the digraph `G-S` is acyclic. |
3355 | 3361 | |
3356 | | For more informations, see |
3357 | | ( http://en.wikipedia.org/wiki/Feedback_arc_set ) |
| 3362 | `Wikipedia article on feedback arc sets |
| 3363 | <http://en.wikipedia.org/wiki/Feedback_arc_set>`_. |
3358 | 3364 | |
3359 | 3365 | INPUT : |
3360 | 3366 | |
… |
… |
|
3467 | 3473 | Equivalently, a minimum feedback vertex set of a DiGraph is a set |
3468 | 3474 | `S` of vertices such that the digraph `G-S` is acyclic. |
3469 | 3475 | |
3470 | | For more informations, see |
3471 | | ( http://en.wikipedia.org/wiki/Feedback_vertex_set ) |
| 3476 | `Wikipedia article on Feedback vertex sets |
| 3477 | <http://en.wikipedia.org/wiki/Feedback_vertex_set>`_. |
3472 | 3478 | |
3473 | 3479 | INPUT : |
3474 | 3480 | |
… |
… |
|
3574 | 3580 | def max_cut(self,value_only=True,use_edge_labels=True, vertices=False): |
3575 | 3581 | r""" |
3576 | 3582 | Returns a maximum edge cut of the graph |
3577 | | ( cf. http://en.wikipedia.org/wiki/Cut_%28graph_theory%29 ) |
| 3583 | |
| 3584 | `Wikipedia article on cuts |
| 3585 | <http://en.wikipedia.org/wiki/Cut_%28graph_theory%29>`_. |
3578 | 3586 | |
3579 | 3587 | INPUT: |
3580 | 3588 | |
… |
… |
|
3708 | 3716 | def flow(self,x,y,value_only=True,integer=False, use_edge_labels=True,vertex_bound=False): |
3709 | 3717 | r""" |
3710 | 3718 | Returns a maximum flow in the graph from ``x`` to ``y`` |
3711 | | ( cf. http://en.wikipedia.org/wiki/Max_flow_problem ) |
3712 | 3719 | represented by an optimal valuation of the edges. |
3713 | 3720 | |
| 3721 | `Wikipedia article on flows |
| 3722 | <http://en.wikipedia.org/wiki/Max_flow_problem>`_. |
| 3723 | |
| 3724 | |
3714 | 3725 | As an optimization problem, is can be expressed this way : |
3715 | 3726 | |
3716 | 3727 | .. MATH:: |
… |
… |
|
3969 | 3980 | def matching(self,value_only=False, use_edge_labels=True): |
3970 | 3981 | r""" |
3971 | 3982 | Returns a maximum weighted matching of the graph |
3972 | | ( cf. http://en.wikipedia.org/wiki/Matching ) |
3973 | 3983 | represented by the list of its edges. |
3974 | 3984 | |
| 3985 | `Wikipedia article on matchings |
| 3986 | <http://en.wikipedia.org/wiki/Matching>`_. |
| 3987 | |
| 3988 | |
3975 | 3989 | Given a graph `G` such that each edge `e` has a weight `w_e`, |
3976 | 3990 | a maximum matching is a subset `S` of the edges of `G` of |
3977 | 3991 | maximum weight such that no two edges of `S` are incident |
… |
… |
|
4035 | 4049 | def dominating_set(self, independent=False, value_only=False,log=0): |
4036 | 4050 | r""" |
4037 | 4051 | Returns a minimum dominating set of the graph |
4038 | | ( cf. http://en.wikipedia.org/wiki/Dominating_set ) |
4039 | 4052 | represented by the list of its vertices. |
4040 | 4053 | |
| 4054 | `Wikipedia article on dominating sets |
| 4055 | <http://en.wikipedia.org/wiki/Dominating_set>`_. |
| 4056 | |
4041 | 4057 | A minimum dominating set `S` of a graph `G` is |
4042 | 4058 | a set of its vertices of minimal cardinality such |
4043 | 4059 | that any vertex of `G` is in `S` or has one of its neighbors |
… |
… |
|
4121 | 4137 | def edge_connectivity(self,value_only=True,use_edge_labels=False, vertices=False): |
4122 | 4138 | r""" |
4123 | 4139 | Returns the edge connectivity of the graph |
4124 | | ( cf. http://en.wikipedia.org/wiki/Connectivity_(graph_theory) ) |
| 4140 | |
| 4141 | `Wikipedia article on connectivity |
| 4142 | <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_. |
4125 | 4143 | |
4126 | 4144 | INPUT: |
4127 | 4145 | |
… |
… |
|
4313 | 4331 | def vertex_connectivity(self,value_only=True, sets=False): |
4314 | 4332 | r""" |
4315 | 4333 | Returns the vertex connectivity of the graph |
4316 | | ( cf. http://en.wikipedia.org/wiki/Connectivity_(graph_theory) ) |
| 4334 | |
| 4335 | `Wikipedia article on connectivity |
| 4336 | <http://en.wikipedia.org/wiki/Connectivity_(graph_theory)>`_. |
4317 | 4337 | |
4318 | 4338 | |
4319 | 4339 | INPUT: |
… |
… |
|
8272 | 8292 | A Lex BFS ( or Lexicographic Breadth-First Search ) is a Breadth |
8273 | 8293 | First Search used for the recognition of Chordal Graphs. |
8274 | 8294 | |
8275 | | More information on this page : |
8276 | | http://en.wikipedia.org/wiki/Lexicographic_breadth-first_search |
| 8295 | `Wikipedia article on Lex-BFS |
| 8296 | <http://en.wikipedia.org/wiki/Lexicographic_breadth-first_search>`_ |
8277 | 8297 | |
8278 | 8298 | INPUT: |
8279 | 8299 | |