Re: [graphviz-interest] Big graph, not following rules?

"Emden R. Gansner" <[email protected]> Thu, 05 Dec 2013 13:13:57 -0500
Newsgroups gmane.comp.video.graphviz
Message-ID <[email protected]>
On 12/2/13 4:35 AM, paul womack wrote:
> Is Graphviz breaking my rules in order to follow more general
> placement contraints? Can I give Graphviz more "slack"
> on these general constraints in order that my rules are
> more closely followed? 
The problem is that your data is inconsistent. You have 16 edges where 
the date of the tail is after the
date of the head, so it is not possible for dot to comply with all of 
your rules. You also have a fair amount
of events that aren't bound to a date, though this probably doesn't hurt.

To check your graph, you can run

     gvpr -f chk.g family_tree.dot

where chk.g is the attached gvpr script.

     Emden

_______________________________________________
[email protected]
http://lists.research.att.com/mailman/listinfo/graphviz-interest
chk.g (text/plain, 685 B)
BEGIN {
  graph_t sg;
  int year[node_t];
  int y, yt, yh;
  node_t n;
  int cnt;

  void doSubg(graph_t s) {
    for (n = fstnode(s); n; n = nxtnode_sg(s,n)) {
      if (n.name == "_*") continue; 
	  y = (int)n.name;
    }
    for (n = fstnode(s); n; n = nxtnode_sg(s,n)) {
      if (n.name == "_*") year[n] = y;
    }
  }
}
BEG_G {
  for (sg = fstsubg($); sg; sg = nxtsubg(sg)) 
    doSubg(sg);
}
E [(tail.name == "_*") && (head.name == "_*")] {
  yt = year[tail];
  yh = year[head];
  if ((yt == 0) || (yh == 0))
    printf ("%s: %d %d\n", $.name, yt, yh);
  else if (yt >= yh) {
    printf ("%s: %d %d\n", $.name, yt, yh);
    cnt++;
  }
}
END {printf (2, "%d bad edges\n", cnt);}