Giter Club home page Giter Club logo

cities's Introduction

Your solution for Cities task

This is your repository for Cities task solution.

Available cities are present in input.txt. Results should be written into output.txt file.

All the code for reading/writing files is already present, so you can focus on solving the task.

Place your code in combine_cities method of main.cpp file:

vector<string> combine_cities(vector<string> available_cities) {
  // TODO replace with your solution!
  return vector<string>();
}

Run main method in main.cpp file and verify that output.txt file is updated:

To submit your solution just push your code to this repo ๐Ÿ˜Ž

Detailed description of the task is here

Happy coding! ๐Ÿ˜‰

OK, lets go!

Thank betterhire, for this interesting task.

It's time to remake it to achieve a better result.

In new solution I used the ant search algorithm with some modifications:

  • the lower and upper limits of pheromones on the edges of the graph
  • elite ants to increase the number of pheromones on the edges of a better way

The one of the main differences is the possibility of the ant returning to the previous vertex of the graph and its passage along other available edges(like a depth-first search algorithm)

Also a key difference is the change in the coefficient Beta if the path improvement has not occurred after a certain number of iterations.

As a result I achieved a 16705 characters in 148346 iterations (WOW) spending only 17584.4 seconds. It should be noted that the maximum result that was achieved in the process of experiments 16715 characters(please see the file best_way.txt).

Therefore, I believe that my algorithm is the best of the proposed solutions here.

cities's People

Contributors

vikt0r-nekrutenko avatar betterhireme 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.