Simple implementation ant colony optimization algorithm
Add this line to your application's Gemfile:
gem 'ant_colony'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ant_colony
graph = YAML.load_file('test_data/test1.yml')
colony = AntColony::Colony.new(graph, beta: 0.8, alpha: 0.7, pop: 200, ph: 0.3, q: 5)
colony.solve
colony.find_path 1 # path from point 1
Or use cli:
ant_colony solve test_data/test1.yml 1 --pop 200 --alpha 0.7
- Fork it ( https://github.com/[my-github-username]/ant_colony/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request