void ExpandedGraph2::expandSkeleton(node v, edge e1, edge e2)
{
    ListConstIterator<edge> i;
    for(i = m_BC.dynamicSPQRForest().hEdgesSPQR(v).begin(); i.valid(); ++i)
    {
        edge et = m_BC.dynamicSPQRForest().twinEdge(*i);

        if (et == 0) insertEdge((*i)->source(),(*i)->target(),*i);

        // do not expand virtual edges corresponding to tree edges e1 or e2
        else if (*i != e1 && *i != e2)
            expandSkeleton(m_BC.dynamicSPQRForest().spqrproper(et),et,0);
    }
}
	void VarEdgeInserterDynCore::ExpandedGraph::expandSkeleton(node v, edge e1, edge e2)
	{
		for (edge ei : m_BC.dynamicSPQRForest().hEdgesSPQR(v))
		{
			edge et = m_BC.dynamicSPQRForest().twinEdge(ei);

			if (et == nullptr)
				insertEdge(ei->source(), ei->target(), ei);

			// do not expand virtual edges corresponding to tree edges e1 or e2
			else if (ei != e1 && ei != e2)
				expandSkeleton(m_BC.dynamicSPQRForest().spqrproper(et), et, nullptr);
		}
	}
	void VarEdgeInserterDynCore::ExpandedGraph::expand(node v, node vPred, node vSucc)
	{
		m_exp.clear();
		while (!m_nodesG.empty())
			m_GtoExp[m_nodesG.popBackRet()] = nullptr;

		edge eInS = nullptr;
		if (vPred != nullptr) {
			eInS = m_BC.dynamicSPQRForest().virtualEdge(vPred, v);
			m_eS = insertEdge(eInS->source(), eInS->target(), nullptr);
		}
		edge eOutS = nullptr;
		if (vSucc != nullptr) {
			eOutS = m_BC.dynamicSPQRForest().virtualEdge(vSucc, v);
			m_eT = insertEdge(eOutS->source(), eOutS->target(), nullptr);
		}

		expandSkeleton(v, eInS, eOutS);

		planarEmbed(m_exp);
		m_E.init(m_exp);
	}
void ExpandedGraph2::expand(node v, node vPred, node vSucc)
{
    m_exp.clear();
    while (!m_nodesG.empty())
        m_GtoExp[m_nodesG.popBackRet()] = 0;

    edge eInS = 0;
    if (vPred != 0) {
        eInS = m_BC.dynamicSPQRForest().virtualEdge(vPred,v);
        m_eS = insertEdge(eInS->source(),eInS->target(),0);
    }
    edge eOutS = 0;
    if (vSucc != 0) {
        eOutS = m_BC.dynamicSPQRForest().virtualEdge(vSucc,v);
        m_eT = insertEdge(eOutS->source(),eOutS->target(),0);
    }

    expandSkeleton(v, eInS, eOutS);

    PlanarModule pm;
    pm.planarEmbed(m_exp);
    m_E.init(m_exp);
}