0

In my implementation I need to find 4 non intersecting spanning trees in a 2D torus. Assuming all the links are bidirectional. and Bidirectional links are not intersecting.

Ex: my 2D torus is of 3 * 3

   | | |
 --0-1-2--
   | | |
 --3-4-5--
   | | |
 --6-7-8--
   | | | 

So, each link here is actually representing a bidirectional link for example there are two edges between 0 and 3. one from 0 towards 3 and one from 3 towards 0.

In output I should get 4 non intersecting spanning trees.

Although I have thought of some algorithm but it fails somehow.

ALgorithm:

I have the torus represented in the form of adjacency matrix. And a link between 0 and 3 are represented by 1 in adjacency matrix at position AM[0][3] and AM[3][0] Node consist of (node_number, parent,weight) Intially I maintain a priorList in which all nodes are set to their (node_number, -1, INT_MAX) but root of spanning tree which is set to (node_number, -1, 0)

  1. Extract node from priorList with minimum weight, such that its parent does not have already a child. (In first iteration it would always be root). This I do by checking in the set of already extracted nodes in MST.
  2. If found then update all its neighbours other than the nodes already extracted from priorList. here by updating I mean update their parents, if already discovered.
  3. Now add the extracted node in 1st step into the MST.
  4. Go to step 1 until priorList is not empty.

It will give 1 MST but will get stuck while getting the 2nd MST from the same Adjacency matrix which was left as output while calculation of 1st MST(By which I mean if I had already used some edges in the 1st MST then I would have removed that edges from the Matrix).

Remember all 4 spanning trees should start from the same given root, and try if I can somehow use variant of Prim's algorithm(http://en.wikipedia.org/wiki/Prim%27s_algorithm).

I don't know any other algorithm as of now, but lets see if someone can help.

atuljangra
  • 457
  • 1
  • 5
  • 9
user3447353
  • 1
  • 1
  • 3
  • How are 4 non-intersecting spanning trees possible at all? There are 4 bidirectional edges incident to each vertex. If one of the spanning trees contains at least 2 edges incident to a vertex, one of the other spanning trees does not connect that vertex to others at all. And if at most one edge is used from each vertex, the connected part of the graph is at most two vertices connected by a single edge. – Gassa Mar 28 '14 at 19:38
  • I'll post a solution as soon as I build one. Till then see this: http://www.researchgate.net/publication/220329881_Independent_Spanning_Trees_on_Multidimensional_Torus_Networks – atuljangra Apr 06 '14 at 22:08

0 Answers0