Skip to content

Latest commit

 

History

History
92 lines (80 loc) · 3.99 KB

README.md

File metadata and controls

92 lines (80 loc) · 3.99 KB

Search Algorithms

This is a series of exercises to help me improve my understanding of programming languages, styles, and algorithms. It may also be useful to others for learning or for reference.

Algorithms

Each algorithm has a very simple test case that matches the basic diagrams shown below. To run a test, see the head of the test file for instructions on how to execute it.

If you'd like some help setting up a basic environment to run the test in, you can download a Vagrant VM from my Vagrantfiles repository.

cd erlang
curl -O https://raw.githubusercontent.com/adlawson/vagrantfiles/master/erlang/Vagrantfile
vagrant up && vagrant ssh
cd /srv
erlc bfs.erl
escript bfs_test.erl

Depth First Search

### [Depth First Search][dfs] Implementation as described by [Prof. Erik Demaine][demaine] in a [recorded lecture][dfs-video] at MIT. The graph constructed in the test is represented in the diagram shown on the right.

Breadth First Search

### [Breadth First Search][bfs] Implementation as described by [Prof. Erik Demaine][demaine] in a [recorded lecture][bfs-video] at MIT. The graph constructed in the test is represented in the diagram shown on the right.

Implementations

Elixir Erlang Golang JavaScript Julia Lua Python
bfs.ex bfs.erl bfs.go bfs.js bfs.jl bfs.lua bfs.py
dfs.ex dfs.erl dfs.go dfs.js dfs.jl dfs.lua dfs.py

License

The MIT License (MIT)

Copyright (c) 2014 Andrew Lawson <http://adlawson.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.