NETWORK.WEAKPOINTS OpenBI
Single points of failure: the nodes and links whose loss alone splits the network, with the nodes and pairs each one cuts off.
Group: Networks. OpenBI’s own: DAX has no function of this name.
Syntax
NETWORK.WEAKPOINTS ( <links>, <from>, <to> [, <weight>] )
| 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. |
weight | Expression optional, evaluated for each row | How heavy each row's link is, such as an amount or a count; never negative. Left out, or given as the constant BLANK (), every row weighs 1. |
Returns
Table. A row a weak point, the most harmful first. Its columns: Rank and Kind; Node for a node, or From and To for a link; Cut off, Pairs cut and Share cut; and Weight.
Remarks
- A weak point is a node or a link that, lost on its own, breaks its part of the network into pieces: a single point of failure. Kind says which; a node fills Node, a link fills From and To.
- Pairs cut counts the pairs of nodes that could reach each other before and no longer can (for a node, pairs of the other nodes); Share cut is that over every pair that could. Cut off counts the nodes left apart from the largest piece that remains.
- The rows come with the most pairs cut first, then the most cut off, a node before a link, then in the nodes' order. Weight is a link's weight, or for a node the weights of its links added up.
- The links are taken both ways: a link one way joins its two ends as a link both ways does. A network with no weak point returns no rows.
- 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.
- Several rows between the same two nodes make one link, and their weights add up. Without a weight each row adds 1, so a pair that appears three times weighs 3.
- With a weight, a row whose weight 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
Where one failure splits the supply chain
The road from Plant B to Depot S is the worst single failure: Depot S, Shop 3 and Shop 4 lose the rest, half of all the pairs that could reach each other. Losing Plant B cuts off the same three, and its roads carry 55 pallets a day between them.
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.WEAKPOINTS ( Chain, [From], [To], [Pallets] ),
"Kind", [Kind],
"Node", [Node],
"From", [From],
"To", [To],
"Pairs cut", [Pairs cut],
"Share cut", [Share cut],
"Weight", [Weight]
)
| Kind | Node | From | To | Pairs cut | Share cut | Weight |
|---|---|---|---|---|---|---|
| Link | (blank) | Depot S | Plant B | 18 | 0.5 | 20 |
| Node | Plant B | (blank) | (blank) | 15 | 0.416666666666667 | 55 |
| Link | (blank) | Depot S | Shop 3 | 14 | 0.388888888888889 | 14 |
| Node | Depot N | (blank) | (blank) | 13 | 0.361111111111111 | 61 |
| Node | Depot S | (blank) | (blank) | 12 | 0.333333333333333 | 34 |
| Link | (blank) | Depot N | Shop 1 | 8 | 0.222222222222222 | 12 |
| Link | (blank) | Depot N | Shop 2 | 8 | 0.222222222222222 | 9 |
| Link | (blank) | Shop 3 | Shop 4 | 8 | 0.222222222222222 | 6 |
| Node | Shop 3 | (blank) | (blank) | 7 | 0.194444444444444 | 20 |
Related functions
NETWORK.CUTS, NETWORK.NODES, NETWORK.LINKS, NETWORK.FLOW.
Open Graph, OpenBI's graph library, does the work: biconnected_components, bridges, connected_components, strength. See the OAX network functions and Open Graph.