Coder Social home page Coder Social logo

mmilunovic / shortest-path-among-polygons Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 2.0 183 KB

Dijkstra's algorithm + visibility graph = shortest path among polygons

Python 100.00%
geometric-algorithms algorithms python shortest-path-algorithm visibility-graph dijkstra-algorithm

shortest-path-among-polygons's Introduction

made-with-python GitHub license

Shortest path among polygons

Solution for Geometric Algorithms course project from Faculty of Computer Science. Detailed problem statement and proposed solution can be found in the book Computational Geometry - Algorithms and Application chapter 15.

Problem statement

Write a program that, that, given a set of disjoint polygons, a start point p, and an endpoint q, computes the shortest path between p and q that does not enter into the interior of any polygon.

Upper bounds: O(n^2log n) time, where n is the total number of edges in the obstacles.

statement

Getting started

Since this project uses a lot of libraries I recommend using requirements.txt. Run the following commands to clone the repo, install all the requirements and run the example.

git clone https://github.com/mmilunovic/Shortest-path-among-polygons.git
cd Shortest-path-among-polygons
pip install -r requirements.txt
python 2.6.py

When you run it you'll be faced with starting window that explains basic commands like Draw, Clear, Start path... Press H to hide it and enter drawing mode.

Use left mouse click to define the edges of the polygon, and the right click to automatically finish the polygon.

Once you've finished your polygons switch to Path mode by pressing S Use the left click to define the start and right click to define the end. Once you've done both the red line representing the path will show up.

You can also drag the mouse while holding the right click to see the path change.

shortest-path-among-polygons's People

Contributors

dependabot[bot] avatar mmilunovic avatar

Stargazers

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