NETWORK.CUTS OpenBI
The weakest ways to split a network by capacity: each cut's capacity, the pairs of nodes it separates and its links.
Group: Networks. OpenBI’s own: DAX has no function of this name.
Syntax
NETWORK.CUTS ( <links>, <from>, <to> [, <capacity>] [, <top>] )
| Parameter | Type | Description |
|---|---|---|
links | Table | The rows that make the network, one link a row: a table of the model or a table expression, as the filters leave it. |
from | Expression evaluated for each row | One end of each row's link, such as a payer, a customer or a place. |
to | Expression evaluated for each row | The other end of each row's link. |
capacity | Expression optional, evaluated for each row | The most each row's link can carry, never negative. Several rows between the same two nodes add up; left out, every row counts 1. |
top | Whole number optional | How many cuts to keep, the weakest first: 10 when left out, 0 for every one. |
Returns
Table. A row a link of each cut, the weakest cut first. Its columns: Cut and Capacity; Smaller side and Pairs; From and To, a link of the cut; and Link capacity.
Remarks
- A cut is a set of links whose loss splits the network in two sides; its Capacity is what those links can carry together, so it is the most that can get from one side to the other.
- For any two nodes, how much can get from one to the other is set by the weakest cut that separates them. The cuts listed are the ones that set this limit for every pair of nodes (the Gomory-Hu tree): one fewer than the nodes of each connected part.
- Cuts are listed by capacity, smallest first, and among equal ones by the pairs they separate, most first. Pairs counts the pairs of nodes the cut separates and Smaller side the nodes on its smaller side; Link capacity is each link's own.
- The links are taken both ways. Where two cuts of the same capacity would do, one of them is given.
- Rows where an end is blank, or where both ends are the same node, add no link; the end that is there still counts as a node.
- With a capacity, a row whose capacity is blank or 0 adds no link either.
- Nodes are compared the way OAX compares values: text without regard to case, and 1 and 1.0 are the same node. A node written two ways is shown with the spelling whose characters sort first by code (ALICE before Alice); a column of the model keeps one spelling of each text, the first it loaded.
- In a measure, the table is the rows the filters leave, so the network follows the slicers and the page: a visual measures the network of the rows in view.
Compared with DAX
An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.
Examples
The weakest places of a supply chain
The three weakest cuts: Shop 4 hangs on one road of 6 pallets a day, Shop 2 on 9, and Shop 1 on 12.
EVALUATE
VAR Chain =
DATATABLE (
"From", STRING, "To", STRING, "Pallets", INTEGER,
{
{ "Supplier", "Plant A", 40 }, { "Supplier", "Plant B", 25 }, { "Plant A", "Depot N", 30 },
{ "Plant B", "Depot N", 10 }, { "Plant B", "Depot S", 20 }, { "Depot N", "Shop 1", 12 },
{ "Depot N", "Shop 2", 9 }, { "Depot S", "Shop 3", 14 }, { "Shop 3", "Shop 4", 6 }
}
)
RETURN
SELECTCOLUMNS (
NETWORK.CUTS ( Chain, [From], [To], [Pallets], 3 ),
"Cut", [Cut],
"Capacity", [Capacity],
"Pairs", [Pairs],
"From", [From],
"To", [To],
"Link capacity", [Link capacity]
)
| Cut | Capacity | Pairs | From | To | Link capacity |
|---|---|---|---|---|---|
| 1 | 6 | 8 | Shop 3 | Shop 4 | 6 |
| 2 | 9 | 8 | Depot N | Shop 2 | 9 |
| 3 | 12 | 8 | Depot N | Shop 1 | 12 |
Related functions
NETWORK.FLOW, NETWORK.WEAKPOINTS, NETWORK.PATH.
Open Graph, OpenBI's graph library, does the work: connected_components, gomory_hu_tree. See the OAX network functions and Open Graph.