Giter VIP home page Giter VIP logo

tsp's Introduction

TSP

CSE 6140 Final Project

Team members:

  • Asra Yousuf
  • Courtney Wong
  • Puting Yu (Roddick)
  • Yu-Ho Hsieh

Description


This is a program to solve traveling salesman problem (TSP) using 5 different kinds of algorithm, including Branch and Bound, Approximation, and Local Search.

Folder Structure


├── src # Source files

├── main # Entry point

├── approx # Approximation package (Courtney)

├── bnb # Branch and Bound (Yu-Ho)

├── ls1 # Local Search 1 (Roddick)

├── ls2 # Local Search 2 (Asra)

├── files # package for file reading and writing API

├── graph # package for storing graph and output format

├── data # TSP data

└── README.md

Compilation & Experiment


If you want to compile it via terminal, please cd to the folder src, then run

javac -cp . Main.java

Then you should find some .class files appearing in your packages folders and src folder. They are compiled files and can be executed.

Then if you run the following command, you should be able to see a distance matrix printed out from the terminal console.

java Main -inst ../data/Cincinnati.tsp -alg BnB -time 1 
  • Please make sure you are in src folder.
  • We will support BnB, Approx, LS1, LS2 alg command options in the end.

Compute function structure


  • Please refer to the function in package bnb/Bnb.java to see the structure.

  • Please maintain a public and static function called compute in each algorithm.

  • Please maintain a while loop which serves as timer and will cut off when time exceeds cut-off time.

  • Please remember to use the following two APIs to update solution when you find out new better solution.

graph.addApproxResult(int apporxCost, double timeStamp)) 
graph.setCurrentBestResult(int cost, List<Integer> routes) // routes.size() may not = # of nodes

tsp's People

Contributors

hsiehyuho avatar asrayousuf avatar

Watchers

James Cloos 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.