Git Product home page Git Product logo

towerallocationusingai's Introduction

Tower Allocation

Build Status

Build Status

This is the code for the first assignment of COL333:Artificial Intelligence. The problem statement can be found here. We have used a Beam Search algorithm with some parallelization introduced to make the search more optimal.

Algorithm

After trying HillClimibingWithRandomRestarts, HillClimbingwithTabu, BeamSearch, BeamSearchWithTabu and BeamSearchWithRandomRestarts; we chose BeamSearchWithRandomRestarts. This algorithm gave the best costs consistently for the maximum no of test cases that were given. We also used a tabu list in this of size 20, thus making the algorithm more general. The one trick that allowed us to get maximum increase in the quality of results was making a better neighbourhood function for the states we defined. To generate the neighbours we would remove any given bid say at position i, after this we add bids from i+1 to n (if possible). This allowed us to have the maximal state at any given time. However this wasn’t complete as we ignored the bids from 1 to i-1 and also didn’t try all the permutations of bids from i+1 to n

Optimizations

We used multi threading, where we ran 3 threads with random initial states and used these threads to update a common variable maxValue which contained the best of all the running threads. The three parallel threads made a random initial state more useful, as the randomness across multiple threads allowed a more general approach to beam search. We forgot to use the -O3 flag and didn’t calculate the value of the state in a delta fashion ( to see the incremental change), instead we calculated it from scratch every time. These optimisations could have made the code perform even better.

towerallocationusingai's People

Contributors

akshittyagi avatar sourkream avatar

Stargazers

 avatar

Watchers

 avatar  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.