views:

144

answers:

1

I've got to do up a state space graph for my AI course, and I was hoping to use GraphViz to make it (so much faster than Dia). The one thing I can't seem to figure out how to do is how to do an "And" connection, which is basically an arc between two lines connecting to the same node. Is this possible?

+1  A: 

Yes. While there's no explicit dot syntax for this, here's the way it's nearly always done:

# just graph set-up
digraph new_graph {
ratio = "auto"
mincross = 2.0

# draw some nodes
"001" [shape=box, regular=1, style=filled, fillcolor="#FCD975"] ;
"017" [shape=circle  , regular=1,style=filled,fillcolor="#9ACEEB"   ] ;
"007" [shape=diamond  , regular=1,style=filled,fillcolor="#FCD975"   ] ;
# the key line--creating tiny node w/ no label, no color
# i use this style because it mimics the 'midpoint' style used in Omnigraffle et al.
"LN01" [shape=diamond,style=filled,label="",height=.1,width=.1] ;

# draw the edges
"001" -> "LN01" [dir=none,weight=1] ;
"007" -> "LN01" [dir=none,weight=1] ;
"LN01" -> "017" [dir=none, weight=2] ;
}

alt text

doug