A linkage problem
Hi there,
I wonder how I can use Sage to solve the following problem, without implementing a full-blown backtracking.
Let G be an undirected simple graph with at least 2k vertices. The graph G would need to be 2k−1-vertex-connected for the problem to hope to have a solution, but this is perhaps beside the point. Let X be a set of 2k distinct vertices s1,...,sk,t1,...,tk of G. Pair these 2k vertices arbitrarily into k pairs (si,ti). The pair (si,ti) means that the vertex si has been paired with the vertex ti. This pairing doesn't altered the graph G in any way. The problem consists of finding k pairwise vertex-disjoint paths between si and ti for each i, or returns that it is not possible to do so.
A graph for which you can find the k vertex-disjoint paths for any possible set X is called k-linked.
Let me give you an example. Suppose I take the 3-cube graph. I am gonna see it as a graph of the polytope 3-cube because the image is better.
P3=polytopes.hypercube(3)
Q3=P3.graph()
Q3.show()
Let me choose 4 vertices arbitrary vertices for my set X, say s1=(1,1,1), t1=(−1,−1,1), s2=(1,−1,1) and t2=(−1,1,1). Pair the vertices as (si,ti). Then we cannot find 2 vertex-disjoint paths, one connecting s1 to t1 and another s2 to t2. However, if I choose X to be s1=(1,1,1), t1=(−1,−1,1) and s2=(−1,−1,−1) and t2=(1,1,−1) we can.
As an aside this shows that the 3-CubeGraph is not 2-linked.
Hope this is a bit clearer now.
Thank you in advance, and regards, Guillermo
Please give the code for an explicit graph G. Also, form the context it is hard to understand what is given, and what should be found. (The index i is used for the "pairs". What are the edges of G? Are the (si,ti) for i∈? all edges of G. An example, with the expected solution to be found, possibly one among many, would be helpful.)
To start with, consider in the sage interpreter
to see how to initialize a graph.
Hi Dan,
Thank you for your comment. I have explained the problem a bit more.
Regards, Guillermo