Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

algorithm to untangle a graph

Thread view: 
grasp06110@yahoo.com - 18 Apr 2006 14:07 GMT
Hi,

Does anyone know of a good algorithm to untangle a graph?  Or to be
more precise:  Does anyone know of a good algorithm that will determine
the arrangement of vertices and edges of a graph such that the number
of edges that cross is minimized?

I am thinking I could use a brute force method that would add vertices
in every possible order in every possible region and add in each new
edge for a vertex in every possible order.  Would this work?  Is there
a more efficient (time and/or space) algorithm?

Any help would be appreciated.  

Thanks,
John
alexandre_paterson@yahoo.fr - 18 Apr 2006 15:39 GMT
Hi,

> Hi,
>
> Does anyone know of a good algorithm to untangle a graph?  Or to be
> more precise:  Does anyone know of a good algorithm that will determine
> the arrangement of vertices and edges of a graph such that the number
> of edges that cross is minimized?

This is not a Java related question...

> I am thinking I could use a brute force method that would add vertices
> in every possible order in every possible region and add in each new
> edge for a vertex in every possible order.  Would this work?  Is there
> a more efficient (time and/or space) algorithm?

Bruce force can work if you have very few vertices/nodes/edges.

You'll be unlikely to find any algorithm that scales well for
"minimizing crossings" is known to be an NP-hard problem.

If your graph is planar there are algorithms to draw it such that
no two edges intersects.

If your graph is non-planar it is known that you can:

- make is temporary scalar by adding "fake" vertices at the crossings
- draw it using some well-known planar-graph drawing algorithm
- remove your dummy vertices

Complexity of this is at least O(n^2 log(n)).

Tutorial on graph drawing here:

www.cs.brown.edu/~rt/papers/gd-tutorial/gd-constraints.pdf
grasp06110@yahoo.com - 18 Apr 2006 20:47 GMT
Thanks for the help with this.  Regarding you comment that this is not
a Java related question, could you advise on a forum better suited for
this type of question?

Thanks,
John
chris brat - 18 Apr 2006 16:05 GMT
There are graphing utilities available which offer a choice of
algorythms - no re-inventing the wheel.

JUNG (Java Universal Network Graph) framework is quite decent.

http://jung.sourceforge.net

Chris
bugbear - 18 Apr 2006 16:22 GMT
> Hi,
>
[quoted text clipped - 9 lines]
>
> Any help would be appreciated.  

Read some of the background stuff here:

http://www.graphviz.org/

  BugBear


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.