this is a bit algorithmic and I’m not sure if it’s fit correctly under SO, let me know if it doesn’t.
I want to implement some kind of distance or similarity function between two labeled star-graphs. For example I can have the following to graph representations:
A = [3 -1 0;
4 1 0;
2 0 1;
2 0 -1]
and
B = [3 -0.8 1
4 1.4 0.4;
2 0.1 1.9]
My idea (which is actually based mostly on a paper I’m reading) is to perform some kind of belief propagation: Let’s say that A is the observed graph – each row is a neighbor of a central node, the first column is the label, the second is the x position and the third one is the y position (positions are relative to the central node). B is a graph in out database, and I want to see how close or similar they are.
In the paper they are calculating the likelihood for the observed graph A given B as the product of the likelihoods for all the nodes. How would you implement this efficiently in matlab?
I would appreciate any thought or inspiration, I’m not looking for a code to solve it, I just want to learn from you masters how would you approach this problem.
Thanks,
J
Having had only a cursory look at that paper, I think what you are looking for is an algorithm for inference in Bayesian networks. There are notoriously computationally expensive and hard to implement, so I do recommend looking for ready-made solutions. Google returns plenty of hits for “matlab graphical models”
— EDIT —
The website posted in one of the comments looks quite detailed, but may be slightly outdated (2005). I’d like to recommend a different piece of software.
I have been using MALLET for a while and I find it quite OK. The authors are really well known in the NLP community. Turns out there is an extension that allows for arbitrary graphical structure- GRMM. Written in Java, open-source. I haven’t used it myself.