# Edge Distance Calculation - In Kibana graph Feature

**URL:** <https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810>\
**Category:** Kibana\
**Tags:** elastic-stack-graph\
**Created:** [December 22, 2022, 7:13am UTC](https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810 "2022-12-22T07:13:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimple.P](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@Dimple.P](https://discuss.elastic.co/u/Dimple.P)\
**Post date:** [December 22, 2022, 7:13am UTC](https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810/1 "2022-12-22T07:13:56Z")

</div>

How does the node "edge distance is calculated" , and why is it different for each node?  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/9/996b2d7a1b3d0157b63965eee0a053e9511de6a6.png)

---

<div class="post-metadata">

**Author:** ![Marco\_Liberati](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marco_liberati/32/82953_2.png) [@Marco\_Liberati](https://discuss.elastic.co/u/Marco_Liberati)\
**Post date:** [December 22, 2022, 9:39am UTC](https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810/2 "2022-12-22T09:39:37Z")

</div>

Hi @Dimple.P

the graph app uses a "force directed layout" to represent nodes and edges on a 2d plane.  
This layout system performs a physics simulation of the given nodes and edges, which works roughly this way:

- each node has a repulsive force that pushes away other nodes
- each edge works like a spring that stretches and compress based on the force above

When these two forces reach an equilibrium then the layout stops.  
The "edge distance" is basically the equilibrium distance the edge spring model reaches.

If you want to know more about it, the force directed model used is the d3 one you can find here: [GitHub - d3/d3-force: Force-directed graph layout using velocity Verlet integration.](https://github.com/d3/d3-force)

---

<div class="post-metadata">

**Author:** ![Dimple.P](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@Dimple.P](https://discuss.elastic.co/u/Dimple.P)\
**Post date:** [December 22, 2022, 11:07am UTC](https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810/3 "2022-12-22T11:07:12Z")

</div>

> [@Marco\_Liberati](#):
>
> the force directed model used is the d3 one you can find here:

Understood, Thankyou for your response..

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 19, 2023, 11:07am UTC](https://discuss.elastic.co/t/edge-distance-calculation-in-kibana-graph-feature/321810/4 "2023-01-19T11:07:42Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
