Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000303graphvizGraph Librariespublic2003-11-06 00:002011-04-28 04:02
Reporteruser442 
Assigned Togviz 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOS*-*-*OS Version
Summary0000303: Edges in subgraphs
Description



For a strict, undirected graph, I thought using agedge in a subgraph
when the edge exists would be similar to aginsert. However, in
the example below, ep is a different object from e. Assuming the
semantics are like libagraph, with the edges being different but
representing the same abstract edge, I tried setting the color attribute,
but clearly ep and e have separate attributes. Also, if
comment line A and uncomment line B, we find that the root graph has
two edges between the nodes, which one wouldn't expect in a strict,
undirected graph.



Steps To Reproduce

typedef char Agraphinfo_t;
typedef char Agedgeinfo_t;
typedef char Agnodeinfo_t;

#include <graph.h>

void
prg(Agraph_t* g)
{
  Agnode_t* n;
  Agedge_t* e;

  fprintf (stderr, "%s\n", g->name);
  for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
      fprintf (stderr, "%s (%x)\n", n->name, n);
      for (e = agfstout(g,n); e; e = agnxtout(g,e)) {
          fprintf (stderr, "%x: %x (%s) -- %x (%s), color = %s\n",
            e, e->tail, e->tail->name, e->head, e->head->name,
            agget(e,"color"));
      }
  }

}

main ()
{
  Agraph_t* g;
  Agraph_t* sg;
  Agnode_t* t;
  Agnode_t* h;
  Agedge_t* e;
  Agedge_t* ep;

  aginit();
  g = agopen ("x", AGFLAG_STRICT);
  agedgeattr (g, "color","");
  t = agnode (g, "a");
  h = agnode (g, "b");
  e = agedge (g, t, h);
  agset (e, "color", "blue");

  sg = agsubg (g, "y");
  aginsert (sg, t);
  aginsert (sg, h);
  ep = agedge (sg, t, h); /* line A */
  /* ep = agedge (sg, h, t); */ /* line B */
  agset (ep, "color", "red");

  prg (g);
  prg (sg);
}

TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID373
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT*
VERSION 1.10
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2011-04-28 04:02 user1 New Issue
2011-04-28 04:02 user1 Assigned To => user1


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker