NETWORK.PROPAGATE OpenBI
Risk spread from flagged nodes (personalized PageRank): each node's risk and rank.
Group: Networks. OpenBI’s own: DAX has no function of this name.
Syntax
NETWORK.PROPAGATE ( <links>, <from>, <to>, <seeds>, <seed> [, <weight>] [, <damping>] [, <directed>] )
| 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. |
seeds | Table | The flagged rows the spreading starts from, such as FILTER ( Accounts, Accounts[Flagged] ). |
seed | Expression evaluated for each row | The node of each row of seeds. |
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. |
damping | Number optional | Between 0 and 1: how far the risk travels before it goes back to the flagged nodes. 0.85 when left out; higher spreads it further. |
directed | Boolean optional | TRUE when each link runs one way, from its first end to its second. FALSE or left out, a link works both ways. |
Returns
Table. A row a node, the riskiest first, with the columns Node, Risk, Rank and Seed.
Remarks
- Risk is the node's personalized PageRank: a walk along the links that starts again from a flagged node (each as likely) instead of jumping anywhere. Nodes close to the flagged ones, by many or heavy links, score high.
- The risks add up to 1. Rank is 1 for the highest; Seed is TRUE for the flagged nodes.
- Heavier links carry more of the risk. Directed, it flows only along the links' direction.
- Seeds that are not nodes of the network are passed over; when none of them is, the call is an error.
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
Risk around one flagged friend
EVALUATE
VAR Links =
DATATABLE (
"From", STRING, "To", STRING,
{
{ "Ann", "Bo" }, { "Ann", "Cy" }, { "Bo", "Cy" }, { "Cy", "Di" },
{ "Di", "Ed" }, { "Ed", "Fay" }, { "Di", "Fay" }, { "Fay", "Gus" }
}
)
VAR Flagged = DATATABLE ( "Person", STRING, { { "Ann" } } )
RETURN
NETWORK.PROPAGATE ( Links, [From], [To], Flagged, [Person] )
| Node | Risk | Rank | Seed |
|---|---|---|---|
| Ann | 0.303775621681424 | 1 | TRUE |
| Cy | 0.244968792607336 | 2 | FALSE |
| Bo | 0.198512463786677 | 3 | FALSE |
| Di | 0.111163610411954 | 4 | FALSE |
| Fay | 0.0702658437633333 | 5 | FALSE |
| Ed | 0.0514050120163289 | 6 | FALSE |
| Gus | 0.0199086557329463 | 7 | FALSE |
Following the money from D
Weighted by the amounts and directed: E, paid by D, carries the most risk after D itself.
EVALUATE
VAR Payments =
DATATABLE (
"Payer", STRING, "Payee", STRING, "Amount", INTEGER,
{
{ "A", "B", 100 }, { "B", "C", 80 }, { "C", "A", 60 }, { "C", "D", 50 },
{ "D", "E", 40 }, { "E", "C", 30 }, { "E", "F", 20 }
}
)
VAR Flagged = DATATABLE ( "Account", STRING, { { "D" } } )
RETURN
NETWORK.PROPAGATE ( Payments, [Payer], [Payee], Flagged, [Account], [Amount], 0.85, TRUE )
| Node | Risk | Rank | Seed |
|---|---|---|---|
| D | 0.298509841036436 | 1 | TRUE |
| E | 0.253733364880971 | 2 | FALSE |
| C | 0.19458585516299 | 3 | FALSE |
| A | 0.0902170783027421 | 4 | FALSE |
| F | 0.08626934405953 | 5 | FALSE |
| B | 0.0766845165573308 | 6 | FALSE |
Related functions
NETWORK.REACH, NETWORK.NODES, NETWORK.CENTRALITY, NETWORK.SIR.NODES.
Open Graph, OpenBI's graph library, does the work: personalized_pagerank_vs. See the OAX network functions and Open Graph.