2
This software may only be used by you under license from AT&T Corp.
3
("AT&T"). A copy of AT&T's Source Code Agreement is available at
4
AT&T's Internet website having the URL:
5
<http://www.research.att.com/sw/tools/graphviz/license/source.html>
6
If you received this software without first entering into a license
7
with AT&T, you have an infringing copy of this software and cannot use
8
it without violating AT&T's intellectual property rights.
13
* Classify edges for rank assignment phase to
14
* create temporary edges.
23
int nonconstraint_edge(edge_t* e)
27
if (E_constr && (constr = agxget(e,E_constr->index))) {
28
if (constr[0] && mapbool(constr) == FALSE) return TRUE;
33
void class1(graph_t* g)
39
for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
40
for (e = agfstout(g,n); e; e = agnxtout(g,e)) {
42
/* skip edges already processed */
43
if (e->u.to_virt) continue;
45
/* skip edges that we want to ignore in this phase */
46
if (nonconstraint_edge(e)) continue;
51
/* skip self, flat, and intra-cluster edges */
55
/* inter-cluster edges require special treatment */
56
if (t->u.clust || h->u.clust) {
57
interclust1(g,e->tail,e->head,e);
61
if ((rep = find_fast_edge(t,h))) merge_oneway(e,rep);
62
else virtual_edge(t,h,e);
65
if ((t == e->tail) && (h == e->head)) {
66
if (rep = find_fast_edge(t,h)) merge_oneway(e,rep);
67
else virtual_edge(t,h,e);
70
f = agfindedge(g,t,h);
71
if (f && (f->u.to_virt == NULL)) rep = virtual_edge(t,h,f);
72
else rep = find_fast_edge(t,h);
73
if (rep) merge_oneway(e,rep);
74
else virtual_edge(t,h,e);
81
void interclust1(graph_t *g, node_t *t, node_t *h, edge_t *e)
84
int offset,t_len,h_len,t_rank,h_rank;
88
t_rank = e->tail->u.rank - e->tail->u.clust->u.leader->u.rank;
91
h_rank = e->head->u.rank - e->head->u.clust->u.leader->u.rank;
93
offset = e->u.minlen + t_rank - h_rank;
94
if (offset > 0) {t_len = 0; h_len = offset;}
95
else {t_len = -offset; h_len = 0;}
98
v->u.node_type = SLACKNODE;
99
t0 = UF_find(t); h0 = UF_find(h);
100
rt = make_aux_edge(v,t0,t_len,CL_BACK*e->u.weight);
101
rh = make_aux_edge(v,h0,h_len,e->u.weight);
102
rt->u.to_orig = rh->u.to_orig = e;