25 for (i =
GD_rank(g)[r].n; i > pos; i--) {
41 static void findlr(
node_t * u,
node_t * v,
int *lp,
int *rp)
55 static void setbounds(
node_t * v,
int *bounds,
int lpos,
int rpos)
62 if (
ND_in(v).size == 0) {
68 bounds[
SLB] = bounds[
HLB] = ord;
70 bounds[
SRB] = bounds[
HRB] = ord;
72 else if ((l < lpos) && (r > rpos));
75 if ((l < lpos) || ((l == lpos) && (r < rpos)))
77 if ((r > rpos) || ((r == rpos) && (l > lpos)))
81 boolean onleft, onright;
82 onleft = onright =
FALSE;
83 for (i = 0; (f =
ND_out(v).list[i]); i++) {
93 if (onleft && (onright ==
FALSE))
94 bounds[
HLB] = ord + 1;
95 if (onright && (onleft ==
FALSE))
96 bounds[
HRB] = ord - 1;
103 int lnode, rnode, r, bounds[4], lpos, rpos, pos;
110 bounds[
HLB] = bounds[
SLB] = lnode - 1;
111 bounds[
HRB] = bounds[
SRB] = rnode + 1;
113 while (lnode <= rnode) {
114 setbounds(rank[lnode], bounds, lpos, rpos);
116 setbounds(rank[rnode], bounds, lpos, rpos);
119 if (bounds[
HRB] - bounds[
HLB] <= 1)
122 if (bounds[
HLB] <= bounds[
HRB])
123 pos = (bounds[
HLB] + bounds[
HRB] + 1) / 2;
125 pos = (bounds[
SLB] + bounds[
SRB] + 1) / 2;
138 int r, place, ypos, h2;
149 place = flat_limits(g, e);
151 if ((n =
GD_rank(g)[r - 1].v[0]))
157 vn = make_vn_slot(g, r - 1, place);
178 if (
GD_rank(g)[r - 1].ht1 < h2)
180 if (
GD_rank(g)[r - 1].ht2 < h2)
185 static void abomination(
graph_t * g)
211 checkFlatAdjacent (
edge_t* e)
228 for (i = lo + 1; i < hi; i++) {
262 int i, j, reset =
FALSE;
270 checkFlatAdjacent (e);
273 for (j = 0; j <
ND_other(n).size; j++) {
276 checkFlatAdjacent (e);
281 for (i = 0; (n =
GD_rank(g)[0].v[i]); i++) {
282 for (j = 0; (e =
ND_flat_in(n).list[j]); j++) {
311 for (j = 0; j <
ND_other(n).size; j++) {
#define ALLOC(size, ptr, type)
void rec_reset_vlists(Agraph_t *)
Agnode_t * virtual_node(Agraph_t *)
void checkLabelOrder(graph_t *g)
Agedge_t * virtual_edge(Agnode_t *, Agnode_t *, Agedge_t *)
CGRAPH_API Agnode_t * agtail(Agedge_t *e)
int rank(graph_t *g, int balance, int maxiter)
CGRAPH_API Agnode_t * aghead(Agedge_t *e)
Agraph_t * dot_root(void *p)
void rec_save_vlists(Agraph_t *)
int flat_edges(Agraph_t *)