Hi there,
I wonder how I can use Sage to solve the following problem, without implementing a full-blown backtracking. Given
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 X of 2k 2k distinct vertices s1,...,sk,t1,...,tk of a (small) graph G and arbitrary G. Pair these 2k vertices arbitrarily into k pairs (si,ti), find (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 si−ti paths.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 Guillermo