java function that finds graph with minimal edge crossings
I am looking for a java function that minimizes the number of edge crossings in a graph.
The input is supposed to be a Graph G(E[],V[]) where V[] is an array of all nodes and E[] is an array of all the edges. The output should be a 2D array of edge elements (E[][]) which contains all pairs of edges crossing each other.
Please see https://www.ads.tuwien.ac.at/research/graphDrawing.html section "Crossing minimization" as an example. Fig 3a and 3b show different representations of the same graph. But fig 3b has the minimal amount of edge crossings. So in this particular case the functions outputarray should have length [1][2] with the elements [0][0]="Node Green Yellow" and [0][1]="Node Pink Orange"
I already looked at JUNG but I couldn't find an inbuilt function for minimization. Most of the libraries that do minimization are commercial and completely overloaded. I am not looking for a graphical output. I only need the minimal possible amount of edge crossings and the involved edges.
I believe that in general, this is an NP-hard problem and you can only get an upper bound on the minimum number of crossings: Crossing number. However, an OGDF C++ library has some layouts that attempt to minimize the number of crossings in an input graph.
链接地址: http://www.djcxy.com/p/29218.html下一篇: java函数可以找到最小边交叉点的图