int  _ChooseTypeOfNonOuterplanarityMinor(graphP theGraph, int v, int R)
{
int  X, Y, W;

	 // Create the initial non-outerplanarity obstruction isolator state.
     if (_InitializeNonplanarityContext(theGraph, v, R) != OK)
         return NOTOK;

     R = theGraph->IC.r;
     X = theGraph->IC.x;
     Y = theGraph->IC.y;
     W = theGraph->IC.w;

     // If the root copy is not a root copy of the current vertex v,
     // then the Walkdown terminated on a descendant bicomp, which is Minor A.
     if (gp_GetPrimaryVertexFromRoot(theGraph, R) != v)
     {
         theGraph->IC.minorType |= MINORTYPE_A;
         return OK;
     }

     // If W has a pertinent child bicomp, then we've found Minor B.
     // Notice this is different from planarity, in which minor B is indicated
     // only if the pertinent child bicomp is also future pertinent.
     if (gp_IsVertex(gp_GetVertexPertinentRootsList(theGraph, W)))
     {
         theGraph->IC.minorType |= MINORTYPE_B;
         return OK;
     }

     // The only other result is minor E (we will search for the X-Y path later)
     theGraph->IC.minorType |= MINORTYPE_E;
     return OK;
}
Beispiel #2
0
int  _ChooseTypeOfNonplanarityMinor(graphP theGraph, int I, int R)
{
int  N, X, Y, W, Px, Py, Z, DFSChild, RootId;

/* Create the initial non-planarity minor state in the isolator context */

     if (_InitializeNonplanarityContext(theGraph, I, R) != OK)
         return NOTOK;

     N = theGraph->N;
     R = theGraph->IC.r;
     X = theGraph->IC.x;
     Y = theGraph->IC.y;
     W = theGraph->IC.w;

/* If the root copy is not a root copy of the current vertex I,
        then the Walkdown terminated because it couldn't find
        a viable path along a child bicomp, which is Minor A. */

     if (theGraph->V[R - N].DFSParent != I)
     {
         theGraph->IC.minorType |= MINORTYPE_A;
         return OK;
     }

/* If W has an externally active pertinent child bicomp, then
     we've found Minor B */

     if (theGraph->V[W].pertinentBicompList != NIL)
     {
         RootId = LCGetPrev(theGraph->BicompLists,
                            theGraph->V[W].pertinentBicompList, NIL);
         DFSChild = RootId;
         if (theGraph->V[DFSChild].Lowpoint < I)
         {
             theGraph->IC.minorType |= MINORTYPE_B;
             return OK;
         }
     }

/* Find the highest obstructing X-Y path */

     if (_MarkHighestXYPath(theGraph) != TRUE)
         return NOTOK;

     Px = theGraph->IC.px;
     Py = theGraph->IC.py;

/* If either point of attachment is 'high' (P_x closer to R than X
     or P_y closer to R than Y along external face), then we've
     matched Minor C. */

     if (theGraph->G[Px].type == VERTEX_HIGH_RXW ||
         theGraph->G[Py].type == VERTEX_HIGH_RYW)
     {
            theGraph->IC.minorType |= MINORTYPE_C;
            return OK;
     }

/* For Minor D, we search for a path from an internal
     vertex Z along the X-Y path up to the root R of the bicomp. */

     if (_MarkZtoRPath(theGraph) != OK)
         return NOTOK;

     if (theGraph->IC.z != NIL)
     {
         theGraph->IC.minorType |= MINORTYPE_D;
         return OK;
     }

/* For Minor E, we search for an externally active vertex Z
     below the points of attachment of the X-Y path */

     Z = _FindExtActivityBelowXYPath(theGraph);
     if (Z != NIL)
     {
         theGraph->IC.z = Z;
         theGraph->IC.minorType |= MINORTYPE_E;
         return OK;
     }

     return NOTOK;
}