Giter Site home page Giter Site logo

Comments (7)

jexp avatar jexp commented on May 27, 2024

That's what dijkstraWithDefaultWeight is for.

apoc.algo.dijkstraWithDefaultWeight(startNode, endNode, 'KNOWS|<WORKS_WITH|IS_MANAGER_OF>', 'distance', 10) YIELD path, weight

from neo4j-apoc-procedures.

stdob avatar stdob commented on May 27, 2024

Thank you, but I know about it. I think, nevertheless, it is not quite correct behavior of the procedure: it would be appropriate not to throw an exception if the property is not found, but reject (filter) this pattern (path).

In fact, the output will only include those paths in which every relationship has a property responsible for the weight, and this property is a number.

from neo4j-apoc-procedures.

jexp avatar jexp commented on May 27, 2024

Ok, fair point.

from neo4j-apoc-procedures.

sarmbruster avatar sarmbruster commented on May 27, 2024

How about using dijekstraWtihDefaultWeight with a very high default value? This way the given relationship should never become a shortest path. Would this be good enough?

from neo4j-apoc-procedures.

jexp avatar jexp commented on May 27, 2024

@stdob what do you think about @sarmbruster's suggestion?

from neo4j-apoc-procedures.

stdob avatar stdob commented on May 27, 2024

@jexp Works, but, in my opinion, this is a workaround ...

from neo4j-apoc-procedures.

maxlazarus avatar maxlazarus commented on May 27, 2024

I agree, if there is no valid property with a numerical value this should fail properly and filter the path. High default weight is a bit of a hack.

from neo4j-apoc-procedures.

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.