mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
ng_util: make more use of small_color_map in DFS
This commit is contained in:
parent
8d178d52ef
commit
9c046db360
@ -214,8 +214,8 @@ bool isFloating(const NGHolder &g) {
|
|||||||
|
|
||||||
bool isAcyclic(const NGHolder &g) {
|
bool isAcyclic(const NGHolder &g) {
|
||||||
try {
|
try {
|
||||||
boost::depth_first_search(g, visitor(DetectCycles(g))
|
boost::depth_first_search(g, DetectCycles(g), make_small_color_map(g),
|
||||||
.root_vertex(g.start));
|
g.start);
|
||||||
} catch (const CycleFound &) {
|
} catch (const CycleFound &) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -243,7 +243,8 @@ bool hasBigCycles(const NGHolder &g) {
|
|||||||
assert(hasCorrectlyNumberedVertices(g));
|
assert(hasCorrectlyNumberedVertices(g));
|
||||||
set<NFAEdge> dead;
|
set<NFAEdge> dead;
|
||||||
BackEdges<set<NFAEdge>> backEdgeVisitor(dead);
|
BackEdges<set<NFAEdge>> backEdgeVisitor(dead);
|
||||||
boost::depth_first_search(g, visitor(backEdgeVisitor).root_vertex(g.start));
|
boost::depth_first_search(g, backEdgeVisitor, make_small_color_map(g),
|
||||||
|
g.start);
|
||||||
|
|
||||||
for (const auto &e : dead) {
|
for (const auto &e : dead) {
|
||||||
if (source(e, g) != target(e, g)) {
|
if (source(e, g) != target(e, g)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user