5

Does anyone know a good Java library for graph comparing by searching maximal common subgraph isomorphism to get information about their similarity? I do not want to compare graphs based on node labels. Or is there any other way how to topologically compare graphs with good Java libraries? Now I am using library SimPack and it is useful but I need something more. Any suggestions will be very helpful.

Janusz
  • 182,484
  • 112
  • 300
  • 368
user311909
  • 53
  • 1
  • 3
  • I would really be interested in knowing the answer; but I strongly suspect that there is no such library. What would be the output of the comparison? – tucuxi Apr 08 '10 at 15:11
  • I expect the output of the comparison to be information about mapping of the nodes betwen graphs - which node from the first graph mapped to which node from second graph and number of their similarity. – user311909 Apr 08 '10 at 15:53

2 Answers2

3

After some browsing, I have found C++ code implementing several matching algorithms (Shmidt-Druffel, Ullman, VF, VF2) without need for edge or node labeling. SimPack uses the Valiente algorithm, which seems to be (I have found no good description) attributed-graph specific. If you rewrite this in Java, or write a JNI library to interface with it, please make it public.

See http://amalfi.dis.unina.it/graph/db/vflib-2.0

A good review of the state of the art can be found in a paper by the authors of the above code: "Thirty years of graph matching in pattern recognition"

tucuxi
  • 16,902
  • 2
  • 40
  • 73
1

You might get some answers from this thread Good Java graph algorithm library?

A couple Java Graph Libraries are: Graph Visualisation Library JGraph

Java Graph Algorithm Library JGraphT

If neither work you'll probably want to arrange graphs using a structure like below and run the algorithm on it.

public class Node<T>
{
    public T NodeData;
    public List<Edge> edges;
}
public class Edge
{
    public Node<S> Source;
    public Node<D> Destination;
    public int weight;
}
Community
  • 1
  • 1
mikek3332002
  • 3,500
  • 4
  • 35
  • 46