public static DAGLinEquationsSet CreateEqsSetForDAG( LinEquationsMatrix linProgMatrix, DAG graph, SortedSet <long> unusedNodes) { DAGLinEquationsSet eqsSet = new(linProgMatrix, graph); SortedDictionary <long, long> nodeToVar = eqsSet.NodeToVar; SortedDictionary <long, long> edgeToVar = eqsSet.EdgeToVar; long sNodeId = graph.GetSourceNodeId(); eqsSet.sVar = eqsSet.AddVarForNode(sNodeId); long tNodeId = graph.GetSinkNodeId(); eqsSet.tVar = eqsSet.AddVarForNode(tNodeId); foreach (long uNodeId in graph.GetInnerNodeIds()) { if (unusedNodes.Contains(uNodeId)) { continue; } eqsSet.AddVarForNode(uNodeId); } foreach (DAGEdge e in graph.Edges) { long edgeId = e.Id; eqsSet.AddVarForEdge(edgeId); } foreach (DAGNode u in graph.Nodes) { long uNodeId = u.Id; if (unusedNodes.Contains(uNodeId)) { continue; } long uNodeVar = nodeToVar[uNodeId]; SortedDictionary <long, RationalNumber> coeffsIn = new() {
public DAGLinEquationsSet(LinEquationsMatrix linProgMatrix, DAG graph) : base(graph) { this.LinProgMatrix = linProgMatrix; }