I’m using in a project Postgresql and PostGIS for a geospatial data model, but now I need also a graph in this structure, so my question is, is there any existing extension for Postgres to build a graph. I found ltree but this is for tree structures only, not for graphs. In general I have different undirected weighted graphs. So I need some routing algorithms based on the graph weights, distance calculation between nodes. My first idea was to use a graph database e.g neo4j, but I have got a limitation, that the whole system should be designed in Postgres. Did you can give some ideas to build a graph within Postgres