UNPKG

gramoloss

Version:

Graph theory package for edition and computation

14 lines (13 loc) 762 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const graph_1 = require("../graph"); const g0 = graph_1.Graph.fromArcs([[0, 1]]); console.log(g0.stronglyConnectedComponents().length == 2); const g1 = graph_1.Graph.fromArcs([[0, 1], [1, 2]]); console.log(g1.stronglyConnectedComponents().length == 3); const g2 = graph_1.Graph.fromArcs([[0, 1], [1, 2], [2, 0], [3, 2], [3, 4], [4, 5], [5, 3]]); console.log(g2.stronglyConnectedComponents().length == 2); const g3 = graph_1.Graph.fromArcs([[0, 1], [1, 2], [2, 0]]); console.log(g3.stronglyConnectedComponents().length == 1); const g4 = graph_1.Graph.fromArcs([[0, 1], [1, 2], [2, 3], [3, 0], [3, 1], [1, 4], [4, 5], [5, 3]]); console.log(g4.stronglyConnectedComponents().length == 1);