GraphStream Users

Archives de la liste Aide


Re: Algorithms step by step


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, ivan.todorovic17 AT gmail.com
  • Subject: Re: Algorithms step by step
  • Date: Sat, 27 Dec 2014 20:19:01 -0300

Hi Ivan, and thanks for using GraphStream !

Hopefully for us, there is no millions of classes and functions. Badly for you, the computation of the tree is a one-block code which can not be splitted for your purpose. But...

Prim, Kruskal and Dijsktra use the same base, AbstractSpanningTree. Here is a draft way to do what you want to do : http://pastebin.com/6RUEnfNa
I guess it will be easy to adapt with a GUI to control the next step by a button.

Cheers.
Guilhelm

2014-12-27 14:00 GMT-03:00 <ivan.todorovic17 AT gmail.com>:
I'am making a demonstrating tool with graphs in java to demonstrate algorithms.
For that purpose I am using graphstream library. I have managed to generate
random graph with random weights on the edges and when I'm using their
algorithm library, everything is working just fine (correct edges are colored).
Since this is a demonstrating tool i would like to make that algorithm step by
step (on a click of a button) so it paints edges in right order. When I tried
to debug library to see how it is working, it was very complex (millions of
functions/classes combined) and at the end it paints all necessary edges as
result. I'am asking here for advice, should i implement my custom algorithm
which should work step by step, or does someone have expirience and thinks i
should edit it to fit my needs.

Algorithms im planning to cover: (prim, kruskal, dijsktra, bfs, dfs).

Thanks in advance!



--
Guilhelm Savin
PhD of Computer Science



Archives gérées par MHonArc 2.6.16.

Top of page