# Best way to represent bidirectional relationships

**URL:** https://community.neo4j.com/t/best-way-to-represent-bidirectional-relationships/47628
**Category:** Cypher
**Tags:** browser
**Created:** [November 18, 2021, 1:17am UTC](https://community.neo4j.com/t/best-way-to-represent-bidirectional-relationships/47628 "2021-11-18T01:17:21Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![halloleo](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/halloleo/32/33621_2.png) [@halloleo](https://community.neo4j.com/u/halloleo)
#### Post date: [November 18, 2021, 1:17am UTC](https://community.neo4j.com/t/best-way-to-represent-bidirectional-relationships/47628/1 "2021-11-18T01:17:21Z")

</div>

Hi there

I'm just starting out to do a bit more with neo4j and I try to represent a truly bi-directional realtionship.

I know neo4j cannot store un-directional relationships (`(a)--(b)`), which would be an option. And I didn't manage to create bidirectional links (`(a)<-->(b)`) either in neo4j. (Maybe I did something wrong?)

So the next best option I though of is creating for every real bidirectional relationship **two** uni-directional relationships:

```auto
(a)-->(b)
(a)<--(b)

```

But this meant I have double as many relationships shown in the graph then really exist!

Also, just defining uni-directional links and using **un** -directional queries doesn't cut it either, because we use Neo4j Browser as visualisation frontend and it always shows the direction of the relationships.

So I'm a bit at a loss. What to do?

---

<div class="post-metadata">

### Author: ![giuseppe\_villan](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/giuseppe_villan/32/11871_2.png) [@giuseppe\_villan](https://community.neo4j.com/u/giuseppe_villan)
#### Post date: [November 19, 2021, 1:22pm UTC](https://community.neo4j.com/t/best-way-to-represent-bidirectional-relationships/47628/2 "2021-11-19T13:22:11Z")

</div>

I don't think is currently possible with Neo4j Desktop / Browser.

You should do something like this to remove directions with pure CSS,

```auto
.relationship .outline {
  d: path('M 25 0.5 L 37.9056 0.5 L 37.9056 -0.5 L 25 -0.5 Z M 59.4681 0.5 L 72.3737 0.5 L 72.3737 -0.5 L 59.4681 -0.5 Z') !important
}

```

But, to style something in Neo4j Browser you could use the `:style` statement,  
as explained [here](https://neo4j.com/developer/neo4j-browser/#browser-styling-adv),  
but this is a pseudo-css, definitely not as complete as real css.

I would suggest you, if direction is important, to choose another viz tool, for example one of [these](https://medium.com/neo4j/15-tools-for-visualizing-your-neo4j-graph-database-ff7315873032) (except Browser or Bloom)

---

<div class="post-metadata">

### Author: ![halloleo](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/halloleo/32/33621_2.png) [@halloleo](https://community.neo4j.com/u/halloleo)
#### Post date: [November 20, 2021, 2:05am UTC](https://community.neo4j.com/t/best-way-to-represent-bidirectional-relationships/47628/3 "2021-11-20T02:05:25Z")

</div>

Thanks @giuseppe_villan!

That's a good aproach: Keeping the links in the database unidirectional, but visualise them bi- or undirectional.

Might try neovis.js or Cytoscape...
