Skip to content

Commit b6538fc

Browse files
committed
fix(utils): remove invalid properties from flow network edges
Remove 'id' and 'directed' properties from generated edges in generateFlowNetworkEdges function - these properties don't exist on TestEdge interface, causing TypeScript compilation errors.
1 parent f41652c commit b6538fc

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

packages/graph-gen/src/generator.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -743,10 +743,8 @@ const generateFlowNetworkEdges = (nodes: TestNode[], edges: TestEdge[], spec: Gr
743743
for (const targetId of intermediateLayer) {
744744
if (rng.next() < sourceConnectivity) {
745745
edges.push({
746-
id: `edge-${source}-${targetId}`,
747746
source,
748747
target: targetId,
749-
directed: true,
750748
weight: Math.floor(rng.next() * 10) + 1, // Capacity 1-10
751749
});
752750
}
@@ -768,10 +766,8 @@ const generateFlowNetworkEdges = (nodes: TestNode[], edges: TestEdge[], spec: Gr
768766
// Avoid backward edges (maintain general flow direction)
769767
if (rng.next() < 0.7) {
770768
edges.push({
771-
id: `edge-${fromId}-${toId}`,
772769
source: fromId,
773770
target: toId,
774-
directed: true,
775771
weight: Math.floor(rng.next() * 10) + 1,
776772
});
777773
}
@@ -784,10 +780,8 @@ const generateFlowNetworkEdges = (nodes: TestNode[], edges: TestEdge[], spec: Gr
784780
for (const sourceId of intermediateLayer) {
785781
if (rng.next() < sinkConnectivity) {
786782
edges.push({
787-
id: `edge-${sourceId}-${sink}`,
788783
source: sourceId,
789784
target: sink,
790-
directed: true,
791785
weight: Math.floor(rng.next() * 10) + 1,
792786
});
793787
}
@@ -796,10 +790,8 @@ const generateFlowNetworkEdges = (nodes: TestNode[], edges: TestEdge[], spec: Gr
796790
// Also add a direct source→sink edge sometimes (higher capacity)
797791
if (rng.next() < 0.3) {
798792
edges.push({
799-
id: `edge-${source}-${sink}`,
800793
source,
801794
target: sink,
802-
directed: true,
803795
weight: Math.floor(rng.next() * 20) + 10, // Higher capacity 10-30
804796
});
805797
}
@@ -811,10 +803,8 @@ const generateFlowNetworkEdges = (nodes: TestNode[], edges: TestEdge[], spec: Gr
811803
const hasEdge = edges.some(e => e.source === source && e.target === targetId);
812804
if (!hasEdge) {
813805
edges.push({
814-
id: `edge-${source}-${targetId}`,
815806
source,
816807
target: targetId,
817-
directed: true,
818808
weight: Math.floor(rng.next() * 10) + 1,
819809
});
820810
if (edges.length >= n - 1) break;

0 commit comments

Comments
 (0)