Files

16 lines
237 B
JavaScript
Raw Permalink Normal View History

2026-04-05 16:14:49 -04:00
var topsort = require("./topsort");
module.exports = isAcyclic;
function isAcyclic(g) {
try {
topsort(g);
} catch (e) {
if (e instanceof topsort.CycleException) {
return false;
}
throw e;
}
return true;
}