Coder Social home page Coder Social logo

Comments (5)

tomkom avatar tomkom commented on June 3, 2024

Did you oconsider emulating the output format of pg_routing (spatial graph extension to Postgres)? https://docs.pgrouting.org/latest/en/pgr_dijkstra.html The format avoids alternating, thus creating a heterogeneous collection. It is a simple edge list.

from duckpgq-extension.

Dtenwolde avatar Dtenwolde commented on June 3, 2024

Hi Tom,

Thanks for the suggestion! What do you mean by that this format avoids alternating?

So far I have been following the SQL/PGQ specification which says the result of the PATH should be a list of alternating vertexIDs and edgeIDs ([v0, e1, v1, ..., ek, vk]). However, I do have plans to work on the path-finding functions, and then I'll keep this in mind.

from duckpgq-extension.

tomkom avatar tomkom commented on June 3, 2024

-- its Martin :)

What I meant is that you do not need a return table of format

V0... attribs
E0...attribs
V1
E1
...

As each edge is defined bybstart/end vertex.
So
E0
E1
...
You can then join the vertices in... but you need to indicate if the edge is traverse in reverse.

Or, with redundancy, but easier to work with,

E0,v0,v1
E1, v1,v2
E2,v2,v3

Where you may possibly already indicate in this manner which is the direction of the edge traversed...

Hope I understood well what you do. This is if the result is a relation (table), as I would assume. See the pg routing docs.

from duckpgq-extension.

Dtenwolde avatar Dtenwolde commented on June 3, 2024

Apologies Martin, that's the last time I'm guessing a first name based on their Github name :)

I sort of see what you mean, but I don't think it'll apply to how the path-finding will look like in our case. Take for example the following query:

	MATCH ANY SHORTEST p = (a WHERE a.id=1)-[e]->{0,3}(b WHERE b.id=3)
	COLUMNS(a.id, b.id, path_length(p), p)

For the following graph:

vertex
id
1
2
3
edges
edgeidsourcetarget
1212
2323

Would return 1 row:

a.id b.id path_length p
1 2 2 [1, 12, 2, 23, 3]
So all the attributes of the vertices and edges that match would result in 1 row, with the actual path being represented as a list. I hope that clears up what we do :)

from duckpgq-extension.

tomkom avatar tomkom commented on June 3, 2024

from duckpgq-extension.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.