You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/examples/basic.md
+14-20Lines changed: 14 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,46 +44,40 @@ network:
44
44
# Parallel edges between A->B
45
45
- source: A
46
46
target: B
47
-
link_params:
48
-
capacity: 1
49
-
cost: 1
47
+
capacity: 1
48
+
cost: 1
50
49
- source: A
51
50
target: B
52
-
link_params:
53
-
capacity: 2
54
-
cost: 1
51
+
capacity: 2
52
+
cost: 1
55
53
56
54
# Parallel edges between B->C
57
55
- source: B
58
56
target: C
59
-
link_params:
60
-
capacity: 1
61
-
cost: 1
57
+
capacity: 1
58
+
cost: 1
62
59
- source: B
63
60
target: C
64
-
link_params:
65
-
capacity: 2
66
-
cost: 1
61
+
capacity: 2
62
+
cost: 1
67
63
68
64
# Alternative path A->D->C
69
65
- source: A
70
66
target: D
71
-
link_params:
72
-
capacity: 3
73
-
cost: 2
67
+
capacity: 3
68
+
cost: 2
74
69
- source: D
75
70
target: C
76
-
link_params:
77
-
capacity: 3
78
-
cost: 2
71
+
capacity: 3
72
+
cost: 2
79
73
"""
80
74
81
75
# Create the network
82
76
scenario = Scenario.from_yaml(scenario_yaml)
83
77
network = scenario.network
84
78
```
85
79
86
-
Note that here we used a simple `nodes` and `links` structure to directly define the network topology. The optional `seed` parameter ensures reproducible results when using randomized workflow steps. In more complex scenarios, you would typically use `groups` and `adjacency` to define groups of nodes and their connections, or even leverage the `blueprints` to create reusable components. This advanced functionality is explained in the [DSL Reference](../reference/dsl.md) and used in the [Clos Fabric Analysis](clos-fabric.md) example.
80
+
Note that here we used a simple `nodes` and `links` structure to directly define the network topology. The optional `seed` parameter ensures reproducible results when using randomized workflow steps. In more complex scenarios, you would typically use node groups with `count` and `template` to define groups of nodes and link rules to define their connections, or even leverage the `blueprints` to create reusable components. This advanced functionality is explained in the [DSL Reference](../reference/dsl.md) and used in the [Clos Fabric Analysis](clos-fabric.md) example.
87
81
88
82
### Flow Analysis Variants
89
83
@@ -138,7 +132,7 @@ result = analyze(network).max_flow_detailed(
@@ -76,4 +76,4 @@ ngraph run scenarios/nsfnet.yaml --keys node_to_node_capacity_matrix_1 --stdout
76
76
77
77
## Notes on results
78
78
79
-
All runs emit a consistent JSON shape with `workflow`, `steps`, and `scenario` sections. Steps like `MaxFlow` and `TrafficMatrixPlacement` store per-iteration lists under `data.flow_results` with `summary` and optional `cost_distribution` or `min_cut` fields. See Reference → Workflow for the exact schema.
79
+
All runs emit a consistent JSON shape with `workflow`, `steps`, and `scenario` sections. Steps like `MaxFlow` and `TrafficMatrixPlacement` store per-iteration lists under `data.flow_results` with `summary` and optional `cost_distribution` or `min_cut` fields. See Reference -> Workflow for the exact schema.
0 commit comments