# computeRoleDrivenRanks

Canonical: https://docs.shumoku.dev/ja/library/api/computeRoleDrivenRanks
Language: ja

@shumoku/core · 0.4.0 · function

# computeRoleDrivenRanks

[ソース](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/problem.ts#L382)

APIの説明は英語のcanonical sourceを表示しています。

Role-driven depth rank, robust to UNDIRECTED inventory cables (NetBox/Zabbix arrow:none). Direction can't be trusted, so the root is chosen by role + structure (the most peripheral boundary device = WAN edge) and depth is the BFS distance over the undirected graph — not raw link from→to (which makes a node whose cable happens to point "outward" a false source, e.g. a server at the top). High fan-out / thin-link sinks are not traversed through; a second pass reaches nodes that sit behind them.

```
computeRoleDrivenRanks(graph: NetworkGraph, sinks?: ReadonlySet<string>): Map<string, number>
```

## パラメーター

| 名前 | 型 | 説明 | 既定値 |
| --- | --- | --- | --- |
| `graph` | `NetworkGraph` | 追加説明はありません。 | `—` |
| `sinks` | `ReadonlySet<string>` | 追加説明はありません。 | `...` |

## 戻り値

```
Map<string, number>
```

[`libs/@shumoku/core/src/layout/problem.ts:382`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/problem.ts#L382)
