#7159: [with patch, needs review] Graph.merge_vertices, and a bug in
edge_boundary
----------------------------+-----------------------------------------------
Reporter: ncohen | Owner: rlm
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.3
Component: graph theory | Keywords:
Work_issues: | Author:
Reviewer: | Merged:
----------------------------+-----------------------------------------------
This patch adds to the Graph class the function merge_vertices.
It is a very common operation in Graph Theory. In a Graph G, one merges
two vertices u and v by deleting them and adding a new vertex, which is
linked to any other vertex w such that there was an edge uw or vw in G.
This can be done with any number of vertices at a time.
Besides, writing this class I noticed there was an error in function
edge_boundary :
the function Graph.edge_boundary([u,v]) returns a list of edges, BUT :
* the edges returned do not always contain u or v as their first
element. it can be the second one in undirected graphs
* The edges between u and v are returned, which is not the expected
behaviour of this function
This patch fixes this too.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7159>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---