GithubHelp home page GithubHelp logo

arian-code / tsp_edge_select Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.37 MB

A python based game for generating tour based on edge selection

License: GNU Lesser General Public License v2.1

Python 100.00%

tsp_edge_select's Introduction

A python based game for generating tour based on edge selection

This code graphically verifies the algorithm to build TSP tour based on edge selection As the edges are selected by user progressively The algorithm, block edges which are invalid for selection The algorithms always results in VALID TOUR SELECTION

Brief algorithm:

START 
    Number of cities <- 'n' 
    All edges are available during initial selection
    WHILE (selected edges < n) do
       Select one of the non-BLOCKED edges:
          All edges in the row of selected edge are BLOCKED
          All edges in the column of selected edge are BLOCKED
          Edges which can create SUB TOUR are BLOCKED    #Routine "sub_tour_check"
          if (pending edges to be selected == non-BLOCKED edges):
              Select all remaining edges                 #No more options available
    END WHILE
END

How to use:

  1. Download the file "tsp_edge_select.py"
  2. Install python dependencies "pygame"
  3. Run: python3 tsp_edge_select.py

=== OR ===

  1. Simply download excutable "tsp_edge_select"
  2. Run: ./tsp_edge_select (Tested on ubuntu / linux only)

=== OR (Simplest)

  1. Try on "https://codehs.com/sandbox/id/pygame-6RucFM" (to view screenshot)
  2. Make sure the output window is maximised and browser is in full creen mode (F11)

Screenshots

This is an image This is an image

tsp_edge_select's People

Contributors

arian-code 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.