Comments (1)
Hi oschakravarthi,
I can not reproduce your problem. For me the hasPathTo function returns true in both cases. Though I had to change your 4th line of code (and in the code block), as it says idijkstra, instead of dijkstra (as declared).
So this code prints true two times on my machine:
const jsgraphs = require('js-graph-algorithms');
var g = new jsgraphs.WeightedGraph(2);
g.addEdge(new jsgraphs.Edge(0, 1, 5.0));
var dijkstra = new jsgraphs.Dijkstra(g, 0);
var has0To1 = dijkstra.hasPathTo(1);
console.log(has0To1); // true
dijkstra1 = new jsgraphs.Dijkstra(g, 1);
var has1To0 = dijkstra.hasPathTo(0);
console.log(has1To0); //true
I suggest to close this issue.
Greetings,
sp1r1t
from js-graph-algorithms.
Related Issues (10)
- Add TypeScript definitions HOT 2
- BellmanFord not working with negative weight edges
- Why its not working with negative weights ?
- When using webpack 5, cannot import this package. HOT 2
- Non numeric node IDs HOT 1
- Ford Fulkerson issue HOT 2
- opened to fast an issue, im sorry.
- Typescript example
- Undeclared variable in Stack.prototype.toArray
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-graph-algorithms.