Tuesday, April 14, 2009

Visualization of Direct Acyclic Graph Models

Graphviz at http://www.graphviz.org/About.php is visualization software that can be used to model direct acyclic graphs. For example, the code:

digraph G{
subgraph leftBrain{
node [style=filled, color=lightgrey];
A -> C [ label = "0.0" ];
C -> E [ label = "0.0" ];
}
subgraph middleBrain{
node [shape=circle, style=filled, color=white];
W -> K [ label = "0.0" ];
K -> V [ label = "0.0" ];
}
subgraph rightBrain{
node[style=filled, color=lightgrey];
B -> D [ label = "0.0" ];
D -> F [ label = "0.0" ];
}
start -> A [ label = "0.0" ];
start -> B [ label = "0.0" ];
start -> W [ label = "0.0" ];
A -> W [ label = "0.0" ];
B -> W [ label = "0.0" ];
D -> K [ label = "0.0" ];
C -> K [ label = "0.0" ];
E -> K [ label = "0.0" ];
F -> K [ label = "0.0" ];
F -> V [ label = "0.0" ];
E -> V [ label = "0.0" ];
E -> F [ label = "0.0" ];
A -> B [ label = "0.0" ];
D -> C [ label = "0.0" ];
V -> end [ label = "0.0" ];

start [shape=Mdiamond];
end [shape=Msquare];
}



generates the image in Figure 1.

Figure 1. Visual Representation




What I like about this application is that I can write the C# or Java code to read and write the above probability maps, i.e. the numerical quantities on the edges are the probabilities, into my software. As above the code illustrates, you can connect subgraphs together and assemble different types of networks for reasoning. This visualization tool then can help with insight into how intelligent agents are solving problems and provide the necessary illustrations for the publication process.

No comments: