https://github.com/mahdavipanah/escapegraph
A solution for a graph escape problem
https://github.com/mahdavipanah/escapegraph
algorithm graph python
Last synced: 4 months ago
JSON representation
A solution for a graph escape problem
- Host: GitHub
- URL: https://github.com/mahdavipanah/escapegraph
- Owner: mahdavipanah
- License: mit
- Created: 2016-11-04T07:02:10.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-09-22T17:28:55.000Z (about 6 years ago)
- Last Synced: 2025-03-27T22:30:13.794Z (8 months ago)
- Topics: algorithm, graph, python
- Language: Python
- Homepage:
- Size: 69.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# Problem's description

# Problem's assumptions
1. Every escape path sould have it's unique set of vertices.
2. If two escape paths have shared vertices, only one of them is accepted as escape path.
3. If two escape paths have shared vertices, The one which has been seen sooner, will be accepted.
4. Order of seeing the paths relate to order of seeing the start points.
5. Order of seeing the start points is the exact order of them in input.txt
# Input rules
The input grid graph informations should be placed in input.txt
* The first line of input.txt is grid's size: n (grid has n 2 nodes)
* The n next lines are informations about nodes:
* Every node has 4 directions that can have one of these values:
* 0: If that direction is not connected.
* 1: If that direction is connected.
* 3: If that direction has no more nodes (the node is on border)
Order of directions are like this: Left-Right-Up-Down
Example of a node's information: 3130
* Next lines (to an empty line) are starting points, each line contains a starting point.
There is an example test case in input.txt. You can read it to see how input.txt should be filled.
# Prerequisites
* Python2 (python 2.7 is tested)