Giter VIP home page Giter VIP logo

teoria_grafow's Introduction

Bellman-Ford Algorithm

Computes shortest paths from a single source vertex to all of the other vertices.

See also: Bellman-Ford algorithm

Input File

Algorithm works perfectly fine with an included preview model in a G.json file, but it is also possible to create own example using given template:

[[source node, target node, weight],
[source node, target node, weight],
                .
                .  
                .
[source node, target node, weight]]

Where each row represents a directed edge and every node is an integer.

Results

Algorithm visualize given model and returns list of distances from a source vertex to all of the other vertices.

Example image

Printed list for a preview model:

Distances: [0, 5, 1, 6, 13, 15, 14]
Predecessors: [None, 0, 0, 1, 3, 4, 1]

Where each integer is a value for a corresponding node to a value's index. For example - shortest distance from a node 0 to a node 5 is 15 units.

Usage

It is recommended to open .ipynb file with Jupyter Notebook. Other IDEs might require activating jupyter widgets manually (e.g. JupyterLab) or will not support at all.

Clone this repository and open file Bellman-Ford.ipynb, then run each cell in a respective order.

Make sure every cell is actived!

teoria_grafow's People

Contributors

kojec1 avatar

Watchers

 avatar

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.