Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 06:08

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



c++ Help with kruskal

Discussion on c++ Help with kruskal within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2012
Posts: 370
Received Thanks: 20
c++ Help with kruskal

___
Hikarim is offline  
Old 05/26/2013, 12:52   #2
 
Hiris's Avatar
 
elite*gold: 99
Join Date: Apr 2011
Posts: 730
Received Thanks: 236
i do not understand the language of your variables, so its hard to help, did you check for circles? You have to make sure that no circles are built in the graph, one way to do this would be creating groups and adding used groups which work together in a group, if groups have collisions, you can detect circles
Hiris is offline  
Old 05/26/2013, 13:08   #3
 
elite*gold: 0
Join Date: Apr 2012
Posts: 370
Received Thanks: 20
OK, tryed to translate as much code as i could to make it more "english-firendly" (edited main post)
Hikarim is offline  
Old 05/26/2013, 14:16   #4

 
Delinquenz's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,160
Received Thanks: 232
In your main function you are opening a switch and end it with } while (...); You can do it on a do-while-loop but not on a switch-condition.

It doesn't work - what does not working? Please try to describe your problem better so that we can try to follow you without testing in our compiler. Does the compiler throw any errors?
Delinquenz is offline  
Old 05/26/2013, 14:27   #5
 
elite*gold: 0
Join Date: Apr 2012
Posts: 370
Received Thanks: 20
it is a do- while statement, the switch is in the do{} statement, lol.

And, about my problem, well, when i use the 3rd option in my menu (kruskal), the program doesnt end the process and gives me the results, instead it is working on something into infinty... so thats ym problem.
Hikarim is offline  
Old 05/26/2013, 14:30   #6
 
Hiris's Avatar
 
elite*gold: 99
Join Date: Apr 2011
Posts: 730
Received Thanks: 236
use debuger of visual studios with this red point thing that u can set and go step by step, check where it goes infinit und change it
Hiris is offline  
Old 05/26/2013, 14:43   #7
 
elite*gold: 0
Join Date: Apr 2012
Posts: 370
Received Thanks: 20
not using visual studio, i am using DevC++, but anyway,... I was checking the sudo code, but it seems i've done everything correct, but it still bugs
Hikarim is offline  
Old 05/26/2013, 15:51   #8

 
マルコ's Avatar
 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Deleting your post and code and everything is the most useful thing to do when asking for help!
マルコ is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Just another graph-related algorithm] Kruskal`s algorithm
07/25/2012 - CO2 Programming - 11 Replies
(Scroll down for the code if you aren`t interested in my wall of text.) Okay, my previous post on Dijkstra`s algorithm didn`t really get the attention it was supposed to get, but I`m still starting a trend out of this. What exactly? I will be posting general purpose algorithms from time to time, as I truly believe that this is one of the most fundamental and important aspect of being a good coder : knowing the basic algorithms (lol?). If anyone can provide a way of implementing this in a CO...



All times are GMT +2. The time now is 06:08.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.