NuclearDispersionSystem/ant-design-vue-jeecg/node_modules/graphlib/lib/alg/is-acyclic.js

16 lines
237 B
Java
Raw Normal View History

2023-09-14 14:47:11 +08: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;
}