%!PS-Adobe-2.0
/Black{0 0 0 1 setcmykcolor} def
/White{0 0 0 0 setcmykcolor} def
/Goldenrod{0 0.10 0.84 0 setcmykcolor} def
/Red{0 1 1 0 setcmykcolor} def
/Yellow{0 0 1 0 setcmykcolor} def
/Cyan{0.5 0 0 0 setcmykcolor} def
/Nodecolor { White } def
/Backcolor { Yellow } def
/Pathcolor { Cyan } def
/nstr 2 string def
/nstr3 3 string def
/nstr4 6 string def
/noderadius 0.2 def
/nodenumsize 0.15 def
/statenumsize 0.15 def
/distnumsize 0.18 def
/numfont {/Times-Bold findfont nodenumsize scalefont setfont} def
/statefont {/Times-Bold findfont statenumsize scalefont setfont} def
/distfont {/Times-Bold findfont distnumsize scalefont setfont} def

/drawnode {
  /state exch def
  /y exch def
  /x exch def
  /i exch def
  /nodepath {
    newpath
    x y noderadius 0 360 arc
  } def
  Nodecolor nodepath fill
  Black nodepath stroke
  numfont
  /n1 {i nstr cvs} def % conv i to string
  /n2 {n1 stringwidth pop 2 div} def % 1/2 n1
  x n2 sub y 0.04 add moveto n1 show
  statefont
  /s1 {state stringwidth pop 2 div} def
  x s1 sub y 0.1 sub moveto state show
} def

/zlineto {
  /dist exch def
  /y2 exch def
  /x2 exch def
  /y1 exch def
  /x1 exch def
  x1 y1 moveto x2 y2 lineto stroke
  /x3 { x1 x2 add 2 div} def
  /y3 { y1 y2 add 2 div} def
  distfont
  /d {dist nstr3 cvs} def % conv dist to string
  /x4 {d stringwidth pop 2 div} def % 1/2 d
  % insert white rectangle
  newpath
  x3 x4 sub 0.01 sub y3 -0.06 add moveto % was -0.05
  x4 2 mul 0 rlineto 
  0 0.15 rlineto % was 0.13
  x4 2 mul neg 0 rlineto
  closepath Backcolor fill
  Black
  x3 y3 moveto
  x4 neg -0.05 rmoveto d show
} def

/all {
% background
Backcolor 
/bdrypath {
  newpath
  0  0 moveto
  0 8 rlineto
  14 0 rlineto
  0 -8 rlineto
  closepath
} def
Backcolor bdrypath fill
Black bdrypath stroke