<p>Lnd itself does not provide the betweeness centrality of your or any nodes. However you access the network with the <a href="https://api.lightning.community/rest/index.html#v1-graph" rel="nofollow noreferrer">graph api call</a> and compute the centrality yourself. You can either implement it yourself by following the instructions from the <a href="https://en.wikipedia.org/wiki/Betweenness_centrality" rel="nofollow noreferrer">Wikipedia article</a> or you can use a graph lib like networkx that does it with <a href="https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.algorithms.centrality.betweenness_centrality.html" rel="nofollow noreferrer">one api call</a> after you passed the network to such a lib. </p>

<p>Also please keep in mind that of corse one can model the weights of the lightning network differently (for example by just taking channels as edges with weight 1) or by trying to model in the fees. When one does so the problem is how to model in the dynamic <code>fee_rate</code> together with the <code>static</code> base_fee_msat` as the resulting fee that one pays would depend on the amount that is being transferred. this amount could change and thus the network would change.</p>

CC BY-SA 4.0
2019-03-12T07:50:42.990Z
2019-03-12T08:17:55.803Z
2019-03-12T08:17:55.803Z
Rene Pickhardt
<p>How can one calculate betweeness centrality of your node as mentioned in <a href="https://www.youtube.com/watch?v=L39IvFqTZk8" rel="nofollow noreferrer">this video</a>. I would like to take into consideration</p>

<ol>
<li><code>base_fee_msat</code> </li>
<li><code>fee_rate</code></li>
</ol>

<p>Is there a smart way to figure out what suites your lnd node?</p>

<lightning-network><full-node><lightning-network-daemon><lncli>
Betweeness Centrality LND node
Kortik
# Betweeness Centrality LND node

(Asked by: username_0 on 2019-03-12)

How can one calculate betweeness centrality of your node as mentioned in [this video](https://www.youtube.com/watch?v=L39IvFqTZk8). I would like to take into consideration

1. `base_fee_msat`
2. `fee_rate`

Is there a smart way to figure out what suites your lnd node?

**Tags:** lightning-network, full-node, lightning-network-daemon, lncli


---

## 1 answers

### Answer by username_1 on 2019-03-12. Score: 3

Lnd itself does not provide the betweeness centrality of your or any nodes. However you access the network with the [graph api call](https://api.lightning.community/rest/index.html#v1-graph) and compute the centrality yourself. You can either implement it yourself by following the instructions from the [Wikipedia article](https://en.wikipedia.org/wiki/Betweenness_centrality) or you can use a graph lib like networkx that does it with [one api call](https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.algorithms.centrality.betweenness_centrality.html) after you passed the network to such a lib.

Also please keep in mind that of corse one can model the weights of the lightning network differently (for example by just taking channels as edges with weight 1) or by trying to model in the fees. When one does so the problem is how to model in the dynamic `fee_rate` together with the `static` base\_fee\_msat` as the resulting fee that one pays would depend on the amount that is being transferred. this amount could change and thus the network would change.


---

