#include #include #include #include #include using namespace ogdf; int main(int n_args, char** args) { if (n_args!= 3) { printf("\n usage: %s \n\n", args[0]); exit(-1); } /* read graph from file */ FILE* fp = fopen(args[1],"r"); int n,m; fscanf(fp,"%d %d",&n,&m); Graph G; node* vertex = new node[n]; for(int i=0;i SNodes = T.nodesOfType(SPQRTree::NodeType::SNode); List::iterator i; for(i=SNodes.begin();i!=SNodes.end();i++) { Graph cycle = T.skeleton(*i).getGraph(); //current cycle; skeleton of an S-node int length = cycle.numberOfNodes(); /* find the number of real edges; if v is on the cycle, then count(v) += n_realEdges - #{real edges that v is incident to} */ edge e = cycle.firstEdge(); int n_realEdges=0; for(int j=0;jsource()); node sG = T.skeleton(*i).original(e->target()); if(!isVirtual) { count[tG->index()]--; count[sG->index()]--; } e=e->succ(); } /* do count(v) += n_realEdges, for every v on the cycle */ node v = cycle.firstNode(); for(int j=0;jindex()]+=n_realEdges; v=v->succ(); } } high_resolution_clock::time_point t2 = high_resolution_clock::now(); duration time_span = duration_cast>(t2 - t1); fp = fopen(args[2],"w"); for(int i=0;i