How to draw horizontal and vertical edges between to node?

  • You can create images like the above, if you are willing/able to position/locate the nodes yourself
  • However, I don’t believe that any of the Graphviz engines will produce a graph anywhere close to the above “on their own” (without lots of user guidance)

Here is a Graphviz file that can be fed to neato (not dot) to produce a copy of your graph. Note the use of the pin and pos attributes

 digraph HV {
  splines=false
  node [label="" width=.2 height=.15 pin=true]
   "n3,4" [pos="4,3"]
   "n5,7" [pos="7,5"]
   "n3,5" [pos="5,3"]
   "n1,2" [pos="2,1"]
   "n3,6" [pos="6,3"]
   "n4,1" [pos="1,4"]
   "n6,5" [pos="5,6"]
   "n3,7" [pos="7,3"]
   "n4,2" [pos="2,4"]
   "n3,8" [pos="8,3"]
   "n1,5" [pos="5,1"]
   "n4,3" [pos="3,4"]
   "n4,4" [pos="4,4"]
   "n4,5" [pos="5,4"]
   "n2,2" [pos="2,2"]
   "n2,3" [pos="3,2"]
   "n4,6" [pos="6,4"]
   "n2,4" [pos="4,2"]
   "n4,7" [pos="7,4"]
   "n2,5" [pos="5,2"]
   "n5,3" [pos="3,5"]
   "n4,8" [pos="8,4"]
   "n2,6" [pos="6,2"]
   "n4,9" [pos="9,4"]
   "n2,7" [pos="7,2"]
   "n5,5" [pos="5,5"]
   "n3,2" [pos="2,3"]
   "n2,8" [pos="8,2"]
   "n3,3" [pos="3,3"]
   "n5,6" [pos="6,5"]
   "n2,2" -> "n1,2"
   "n3,2" -> "n2,2"
   "n4,2" -> "n3,2"
   "n4,1" -> "n4,2"
   "n4,2" -> "n4,3"
   "n4,3" -> "n4,4"
   "n4,4" -> "n4,5"
   "n4,5" -> "n4,6"
   "n4,6" -> "n4,7"
   "n4,7" -> "n4,8"
   "n4,8" -> "n4,9"
   "n5,5" -> "n5,6"
   "n4,5" -> "n5,5"
   "n4,3" -> "n5,3"
   "n4,7" -> "n5,7"
   "n2,2" -> "n2,3"
   "n3,2" -> "n3,3"
   "n3,3" -> "n3,4"
   "n2,5" -> "n2,4"
   "n2,5" -> "n1,5"
   "n2,5" -> "n2,6"
   "n3,5" -> "n3,6"
   "n3,7" -> "n2,7"
   "n4,7" -> "n3,7"
   "n4,8" -> "n3,8"
   "n2,7" -> "n2,8"
   "n5,5" -> "n6,5"
   "n4,5" -> "n3,5"
   "n3,5" -> "n2,5"
}

Giving: