GithubHelp home page GithubHelp logo

adlawson / search-algorithms Goto Github PK

View Code? Open in Web Editor NEW
71.0 4.0 17.0 186 KB

Search algorithms implemented in different languages

License: MIT License

Elixir 17.65% Erlang 15.35% Go 15.15% JavaScript 15.99% Julia 12.74% Lua 13.34% Python 9.78%

search-algorithms's People

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

Watchers

 avatar  avatar  avatar  avatar

search-algorithms's Issues

bfs.lua not correct on starting node other than 1

I tried your bfs.lua code (it is high on google search for "bfs lua"). however, I'm not sure if it is entirely correct. While your test gives the expected result when the starting node is 1, just using a random other starting node doesn't give me the expected results:
Replacing 1 by 7 in your test case, I get this output
7, 4, 11, 12, 7, 8, 7, 7, 11, 12, 11, 12, 11, 12
Nodes missing (anything smaller than 7 it seems), many being duplicated; pretty sure this is not correct.

Elixir algorithms don't work on Elixir 1.5.2

BFS fails on line 31:

Bug Bug ..!!** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 1 (elixir) lib/access.ex:329: Access.get/3 lib/bsf.ex:39: anonymous fn/3 in Bfs.frontier_adj/2 (elixir) lib/enum.ex:1826: Enum."-reduce/3-lists^foldl/2-0-"/3 lib/bsf.ex:31: Bfs.visit_frontier/3

And DFS Fails on line 22:

Bug Bug ..!!** (ArgumentError) the Access calls for keywords expect the key to be an atom, got: 1 (elixir) lib/access.ex:329: Access.get/3 lib/dfs.ex:22: Dfs.visit/3

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.