Questions on Prim's algorithm

J

Jack

I would like to know how the minimum spanning tree can be achieved in
this way, just a few explanation for guidance is ok:

In the following example, 999 represents they are not connected. There
are altogether 6 vertexes.

The adjacency matrix:
(0 2 999 3 999 999,
2 0 999 999 5 999,
999 999 0 1 999 999,
999 3 999 1 0 999 7,
999 5 999 999 0 4,
999 999 999 7 4 0)

The starting vertex:
0

Minimum spanning tree:
0 2 999 999 999 999
2 0 999 999 5 999
999 999 0 1 999 999
999 999 1 0 999 7
999 5 999 999 0 4
999 999 999 7 4 0
 
K

Keith Thompson

Jack said:
I would like to know how the minimum spanning tree can be achieved in
this way, just a few explanation for guidance is ok:

In the following example, 999 represents they are not connected. There
are altogether 6 vertexes.

The adjacency matrix:
(0 2 999 3 999 999,
2 0 999 999 5 999,
999 999 0 1 999 999,
999 3 999 1 0 999 7,
999 5 999 999 0 4,
999 999 999 7 4 0)

The starting vertex:
0

Minimum spanning tree:
0 2 999 999 999 999
2 0 999 999 5 999
999 999 0 1 999 999
999 999 1 0 999 7
999 5 999 999 0 4
999 999 999 7 4 0

That's not really a C question. Try comp.programming.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top