Files
lan-manager/web/node_modules/@antv/graphlib/lib/comparision/complement.js
openclaw 0a5f6a8047 Initial commit: Lan-manager project code
- Go backend (server/)
- Frontend (web/, server/static/)
- Database and deployment files
- Scripts and docs

Co-Authored-By: 狸花猫/Claude-Qwen3.6-Plus 🐾
2026-04-20 00:52:58 +08:00

24 lines
923 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isGraphComplement = void 0;
var essence_1 = require("../essence");
var contain_1 = require("./contain");
/**
* @description Check if one graph is the complement of another graph.
* @description.zh-CN 检查一个图是否是另一个图的补图。
*/
var isGraphComplement = function (originGraph, targetGraph) {
if (!(0, essence_1.isSimpleGraph)(originGraph) || !(0, essence_1.isSimpleGraph)(targetGraph)) {
return false;
}
if (!(0, contain_1.containAllSameNodes)(originGraph, targetGraph)) {
return false;
}
if ((0, contain_1.containSameEdges)(originGraph, targetGraph)) {
return false;
}
var nodeCount = originGraph.nodeCount();
return originGraph.edgeCount() + targetGraph.edgeCount() === (nodeCount * (nodeCount - 1)) / 2;
};
exports.isGraphComplement = isGraphComplement;