Prims and Kruskals algorithm

Hi guys: I give the name on each vertax a,b,c,d,e,f,g,h. Can any one please tell me how to find a minimal spanning tree and compute its total weight on this diagram?

Thanks.

qq2.jpg
mustish1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tliottaCommented:
Edges cd and ce have no weights that I can see. Is that intended or does it indicate zero or 'unknown'? Is fh weighted 5 or 8? (I can't quite decide.)

Tom
0
mustish1Author Commented:
sorry
fh=5
cd=2
ce=8
0
mustish1Author Commented:
0
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

Neil RussellTechnical Development LeadCommented:
There is an excellant article from the University of california HERE that will lead you to your answer.

It is often far better to learn from your own experimentation than to be given just the answer.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mustish1Author Commented:
i want to do b ymyself. please let me know if i go wrong
0
mustish1Author Commented:
BC is the shortest arc with length 1.

so now BA and BE
BE is the shortest arc with length 2.

so now AC and AD
AD is the shortest arc with length 1.

AC create loop or circuit so we cant use it.

am i doing right?
0
Neil RussellTechnical Development LeadCommented:
Do you know Java?
This article includes lots of Java code examples to help explain the workings.

http://algs4.cs.princeton.edu/43mst/
0
mustish1Author Commented:
so now DG and DF
DG is the shortest arc with length 8

DF is the shortest arc with length 7

EF is the shortest arc with length 3
FH is the shortest arc with length 5
GH is the shortest arc with length 6

I THINK REST OF THEM CREATE CIRCUIT

0
mustish1Author Commented:
ONE MORE

DC is the shortest arc with length 2
0
mustish1Author Commented:
0
mustish1Author Commented:
Can experts please tell me if i did right
0
Neil RussellTechnical Development LeadCommented:
Nope you have loops/cycles
a-d
d-c
c-b
b-e
e-f
f-h
d-d OR h-g

Is the MST
0
Neil RussellTechnical Development LeadCommented:
Sorry thats
d-g OR h-g
0
tliottaCommented:
AB completes a circuit for ABCDA.

Tom
0
mustish1Author Commented:
0
mustish1Author Commented:
is this is correct?
0
Neil RussellTechnical Development LeadCommented:
No you still have loops. I gave you the solution above in #37228420
Can you see why if you draw it?
0
Neil RussellTechnical Development LeadCommented:
From any ONE vertex (x) there should and can only be one path to any other vertex (y)
You have a-b-e-f-d-a
d-g-h-f-d
etc
LOOPS
0
Neil RussellTechnical Development LeadCommented:

An easier to visualize example. Better example viually
0
mustish1Author Commented:
> I gave you the solution above in #37228420

Why you start with 3 instead of 1 ?
0
phoffric\Commented:
Actually you can start with any vertex. But, it is possible that when starting from different vertices, you will get multiple solutions all having the same minimum value.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Math / Science

From novice to tech pro — start learning today.