GithubHelp home page GithubHelp logo

dijkstra's People

Contributors

andrewhayward avatar tetratorus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dijkstra's Issues

node reference to more than two nodes

thank you for your code, i just want to ask you if we have a node which go to more than two nodes for example : node a go to b, c, d, e. is it possible to set our map like that:
var map = {a:{b:1,c:3,d:2,e:5},
....
....
}

Unused global variable "predecessor" at line 73

On line 73 of graph.js, there is
predecessor = predecessors[u];

predecessor is not predefined so it ends up in the global scope. I'm not quite sure what it's supposed to do in the first place considering it's not used anywhere.

Bugs in the code and bad description. please update

Poor description. The cod also does not work. There is no way to dynamically set keys for objects in javascript . I guess that a map function must be used t0 produce that weird crazy structure for an adjacency matrix

Different JS Structure

Hi andrew, thanks for this code.
There's a way to implement this structure:

var map = [
    {
        node: 'a',
        next: [
            {
                id: 'b',
                weigth: 3
            },
            {
                id: 'c',
                weigth: 1
            }
        ]
    }, {
        node: 'b',
        next: [
            {
                id: 'a',
                weigth: 2
            },
            {
                id: 'c',
                weigth: 1
            }
        ]
    }, {
        node: 'c',
        next: [
            {
                id: 'a',
                weigth: 4
            },
            {
                id: 'd',
                weigth: 2
            }
        ]
    }, {
        node: 'd',
        next: []
    }
]

instead of

var map = {
    a: {
        b: 3,
        c: 1
    },
    b: {
        a: 2,
        c: 1
    },
    c: {
        a: 4,
        b: 1
    },
    d: {}
}

I ask you this because i have some nodes with alphanumeric string (e.g. 145EMA3) and the JS notation not allow the number into object key.

Dijkstra for underground ?

Hello Andrew,

I would like to use your dijkstra algorithm for the underground but I face some problems :

  • how can I add cost when you make a transfer ?
  • how can I add the line and direction you have to take ?

Could you give me a simple sample ?

I looked for weeks but didn't find anything.

Many thanks

Dijkstra with weight in result?

Maybe you can output the result as an array include:
[Route, WeightInTotal]

just added up the weight. that's really helpful

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.