Giter Club home page Giter Club logo

graph-algorithms's People

Contributors

astares avatar dkgoutham avatar ducasse avatar jecisc avatar jordanmontt avatar privat avatar sanjaybhat2004 avatar sergestinckwich avatar stephaneggermont avatar virenvarma007 avatar

Stargazers

 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

graph-algorithms's Issues

Benchmark the algorithms

It is important to benchmark the algorithms

  • To see where are our bottlenecks and know what we can improve. I'm thinking on the use of data structures for example.

Also we need to benchmark our algorithms against industrial implementation to see how we are positioned against those

Adding nodes can have a complexity of O(V^2)

If we go through the AIGraphAlgorithm class, while adding each node we see that we are searching if the node exists.

nodes: aNodeList

    aNodeList do: [ :model | self addNodeFor: model ]
addNodeFor: aModel

    ^ self
          findNode: aModel
          ifAbsent: [ nodes add: (self nodeClass with: aModel) ]
         
findNode: aModel ifAbsent: aBlock

    "^ nodes findBinary: (self findBinaryBlock: aModel) ifNone: aBlock"

    ^ nodes detect: [ :node | node model = aModel ] ifNone: aBlock

The searching is done in O(V) operations, which makes creation of the graph take O(V^2) operations. Hence it is important to analyse improvements on this.

Look if the implementation of the binary sorting of nodes works as expected and add tests

Currently the nodes are stores in a collection. We have two types of nodes: the "model nodes" that are the ones that the user send as a parameters; and the graph nodes which are nodes that we use internally as a data structure. We store those nodes in a collection. When we want to search in which graph node is a given user node we need to do a linear search. There is support for doing a binary search.

This issue is to make sure that the binary search is done right and it works on all cases and to add tests.

Not returning explicitly anything on Prim's algo

Currently, our Prim's algo implementation explicitly returns in the method run. See AIPrim>>#run. The last line it returns the edges.
This breaks the API convention for all the other algos. If one checks, all of the other algos they do not explicitly return anything. We need to update the Prim's algo to not explicitly return in the run method but rather having a method called reconstructPath like in AIBFS for example.

Fix Dijkstra algo

Now Dijkstra is not returning the shortest path for all cases. See the Dijsktra test for more details

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.