Documentation: Programming guide

Dependency graphs

SPIRIT provides two graphs that visualize the logical and probabilistical dependencies among the variables in a knowledge base. There are two kinds of graphs supported. The nodes of these graphs are the variables.

Defining a Graph

There is no direct way of defining or editing a dependency graph, because it is derived from the actual set of rules. So you do not need to worry about the graph at all. Its only use is to visualize the dependencies in a knowledge base.

Visualising a Graph

There are three methods to get the actual graphs. For each node you should call KBase.graphAdjacentVars to find out the list of linked nodes. After receiving such a list, you could call KBase.graphEdgeType to determine the type of edge between two linked nodes. Depending on the selected graph type, an edge can be either an undirected arc or an arrow, whereby arrows might point to both directions. Finally, you can compute the thickness of an edge using the KBase.graphEdgeThickness method. Due to the complexity of the underlying algorithm, this method takes quite a long time to finish.