57 idx_t ehead,
i, mdeg, mdlmt, mdeg_node, nextmd, num, tag;
76 nextmd = invp[mdeg_node];
77 marker[mdeg_node] = maxint;
78 invp[mdeg_node] = -num;
92 while (
head[mdeg] <= 0)
101 mdeg_node =
head[mdeg];
102 while (mdeg_node <= 0) {
107 mdeg_node =
head[mdeg];
111 nextmd = invp[mdeg_node];
114 perm[nextmd] = -mdeg;
115 invp[mdeg_node] = -num;
116 *ncsub += mdeg + qsize[mdeg_node] - 2;
117 if ((num+qsize[mdeg_node]) > neqns)
125 for (
i = 1;
i <= neqns;
i++)
126 if (marker[
i] < maxint)
130 mmdelm(mdeg_node,
xadj,
adjncy,
head, invp,
perm, qsize,
list, marker, maxint, tag);
132 num += qsize[mdeg_node];
133 list[mdeg_node] = ehead;
143 mmdupd( ehead, neqns,
xadj,
adjncy,
delta, &mdeg,
head, invp,
perm, qsize,
list, marker, maxint, &tag);
174 idx_t element,
i, istop, istart,
j,
176 nabor, node, npv, nqnbrs, nxnode,
177 pvnode, rlmt, rloc, rnode, xqnbr;
181 marker[mdeg_node] = tag;
182 istart =
xadj[mdeg_node];
183 istop =
xadj[mdeg_node+1] - 1;
191 for (
i = istart;
i <= istop;
i++ ) {
193 if ( nabor == 0 )
break;
194 if ( marker[nabor] < tag ) {
197 list[nabor] = element;
207 while ( element > 0 ) {
213 jstop =
xadj[link+1] - 1;
214 for (
j = jstart;
j <= jstop;
j++ ) {
217 if ( node < 0 )
goto n400;
218 if ( node == 0 )
break;
219 if ((marker[node]<tag)&&(
forward[node]>=0)) {
222 while ( rloc >= rlmt ) {
225 rlmt =
xadj[link+1] - 1;
231 element =
list[element];
233 if ( rloc <= rlmt )
adjncy[rloc] = 0;
239 istop =
xadj[link+1] - 1;
240 for (
i = istart;
i <= istop;
i++ ) {
243 if ( rnode < 0 )
goto n1100;
244 if ( rnode == 0 )
return;
247 pvnode = backward[rnode];
248 if (( pvnode != 0 ) && ( pvnode != (-maxint) )) {
251 if ( nxnode > 0 ) backward[nxnode] = pvnode;
252 if ( pvnode > 0 )
forward[pvnode] = nxnode;
254 if ( pvnode < 0 )
head[npv] = nxnode;
258 jstart =
xadj[rnode];
259 jstop =
xadj[rnode+1] - 1;
261 for (
j = jstart;
j <= jstop;
j++ ) {
263 if ( nabor == 0 )
break;
264 if ( marker[nabor] < tag ) {
271 nqnbrs = xqnbr - jstart;
274 qsize[mdeg_node] += qsize[rnode];
276 marker[rnode] = maxint;
278 backward[rnode] = -maxint;
284 adjncy[xqnbr] = mdeg_node;
286 if ( xqnbr <= jstop )
adjncy[xqnbr] = 0;
308 idx_t fnode, ndeg, node;
310 for ( node = 1; node <= neqns; node++ ) {
318 for ( node = 1; node <= neqns; node++ ) {
325 if ( fnode > 0 ) backward[fnode] = node;
326 backward[node] = -ndeg;
350 idx_t father, nextf, node, nqsize, num, root;
352 for ( node = 1; node <= neqns; node++ ) {
353 nqsize = qsize[node];
354 if ( nqsize <= 0 )
perm[node] = invp[node];
355 if ( nqsize > 0 )
perm[node] = -invp[node];
359 for ( node = 1; node <= neqns; node++ ) {
360 if (
perm[node] <= 0 ) {
365 while (
perm[father] <= 0 )
366 father = -
perm[father];
370 num =
perm[root] + 1;
376 nextf = -
perm[father];
377 while ( nextf > 0 ) {
378 perm[father] = -root;
380 nextf = -
perm[father];
386 for ( node = 1; node <= neqns; node++ ) {
416 idx_t deg, deg0, element, enode, fnode,
i, iq2, istop,
417 istart,
j, jstop, jstart, link, mdeg0, mtag, nabor,
418 node, q2head, qxhead;
420 mdeg0 = *mdeg +
delta;
424 if ( element <= 0 )
return;
429 if ( mtag >= maxint ) {
431 for (
i = 1;
i <= neqns;
i++ )
432 if ( marker[
i] < maxint ) marker[
i] = 0;
447 istop =
xadj[link+1] - 1;
448 for (
i = istart;
i <= istop;
i++ ) {
451 if ( enode < 0 )
goto n400;
452 if ( enode == 0 )
break;
453 if ( qsize[enode] != 0 ) {
454 deg0 += qsize[enode];
455 marker[enode] = mtag;
458 if ( backward[enode] == 0 ) {
461 list[enode] = qxhead;
464 list[enode] = q2head;
476 if ( enode <= 0 )
goto n1500;
477 if ( backward[enode] != 0 )
goto n2200;
482 istart =
xadj[enode];
484 if ( nabor == element ) nabor =
adjncy[istart+1];
496 istop =
xadj[link+1] - 1;
497 for (
i = istart;
i <= istop;
i++ ) {
500 if ( node != enode ) {
501 if ( node < 0 )
goto n1000;
502 if ( node == 0 )
goto n2100;
503 if ( qsize[node] != 0 ) {
504 if ( marker[node] < *tag ) {
509 if ( backward[node] == 0 ) {
513 qsize[enode] += qsize[node];
515 marker[node] = maxint;
517 backward[node] = -maxint;
520 if (backward[node]==0) backward[node] = -maxint;
534 n1600:
if ( enode <= 0 )
goto n2300;
535 if ( backward[enode] != 0 )
goto n2200;
540 istart =
xadj[enode];
541 istop =
xadj[enode+1] - 1;
542 for (
i = istart;
i <= istop;
i++ ) {
544 if ( nabor == 0 )
break;
545 if ( marker[nabor] < *tag ) {
546 marker[nabor] = *tag;
556 jstop =
xadj[link+1] - 1;
557 for (
j = jstart;
j <= jstop;
j++ ) {
560 if ( node < 0 )
goto n1700;
561 if ( node == 0 )
break;
562 if ( marker[node] < *tag ) {
574 deg = deg - qsize[enode] + 1;
577 backward[enode] = -deg;
578 if ( fnode > 0 ) backward[fnode] = enode;
580 if ( deg < *mdeg ) *mdeg = deg;
585 if ( iq2 == 1 )
goto n900;
591 element =
list[element];