All Projects → arun1729 → Road Network

arun1729 / Road Network

Licence: mit
QuadTree Model for generating random road network

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Road Network

Js Tree List
Convert list to tree, managing a tree and its nodes.
Stars: ✭ 30 (-50.82%)
Mutual labels:  tree
Treedrawer
treedrawer is a Go module for drawing trees on the terminal.
Stars: ✭ 43 (-29.51%)
Mutual labels:  tree
Repository Tree
🌲Pretty display directory tree view of a GitHub repository.
Stars: ✭ 56 (-8.2%)
Mutual labels:  tree
Jqtree
Tree widget for jQuery
Stars: ✭ 977 (+1501.64%)
Mutual labels:  tree
Genericn Arytree
Simple Generic N-ary Tree implementation in Java, with many utility methods.
Stars: ✭ 40 (-34.43%)
Mutual labels:  tree
Angular Tree Component
A simple yet powerful tree component for Angular (>=2)
Stars: ✭ 1,031 (+1590.16%)
Mutual labels:  tree
React Native Pathjs Charts
Android and iOS charts based on react-native-svg and paths-js
Stars: ✭ 877 (+1337.7%)
Mutual labels:  tree
Dockviz
Visualizing Docker data
Stars: ✭ 1,104 (+1709.84%)
Mutual labels:  tree
G6
♾ A Graph Visualization Framework in JavaScript
Stars: ✭ 8,490 (+13818.03%)
Mutual labels:  tree
Geeksforgeeks Dsa 2
This repository contains all the assignments and practice questions solved during the Data Structures and Algorithms course in C++ taught by the Geeks For Geeks team.
Stars: ✭ 53 (-13.11%)
Mutual labels:  tree
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-42.62%)
Mutual labels:  tree
Vue Treeselect
A Tree Select Plugin For Vue2.0+
Stars: ✭ 40 (-34.43%)
Mutual labels:  tree
Pibench
Benchmarking framework for index structures on persistent memory
Stars: ✭ 46 (-24.59%)
Mutual labels:  tree
Algorithms
Study cases for Algorithms and Data Structures.
Stars: ✭ 32 (-47.54%)
Mutual labels:  tree
Bootstraptable Treeview
bootstrapTable extension of treeView
Stars: ✭ 57 (-6.56%)
Mutual labels:  tree
Tree printer
A Java class for printing binary trees as ASCII text
Stars: ✭ 20 (-67.21%)
Mutual labels:  tree
Algorithm Notes
Comprehensive algorithms solution to help engineers prepare their interviews and future study
Stars: ✭ 44 (-27.87%)
Mutual labels:  tree
Ki
Go language (golang) full strength tree structures (ki in Japanese)
Stars: ✭ 61 (+0%)
Mutual labels:  tree
Angular2 Tree Diagram
Angular Hierarchical UI module
Stars: ✭ 50 (-18.03%)
Mutual labels:  tree
Angular Draggable Mat Tree
Example implementation of drag and drop on Angular Material Tree
Stars: ✭ 47 (-22.95%)
Mutual labels:  tree

Python 2.7 License: MIT

QuadTree model for generating random road networks

Generate a sample road network

  • clone repo and then run the following
cd road-network/rng
python network_gen.py <plane size> <number of nodes>

output

Generating road network...
*** Tree Stats ***
...
generating squares...
writing data to files...
# of edges: 1099
generate road network image at: /path/to/your/dir/road-network/rand-quad-road-network.png
node list at: /path/to/your/dir/road-network/node-list
edge list at: /path/to/your/dir/road-network/edge-list
Done

About the model

ScreenShot

QuadTree Model

Eisenstat introduces random road network generation using QuadTree data structure in [Eis10 ]. This project implements that model in python and can be used to generate random road network of varying sizes.

QuadTree implementation

The main component of the model is the Quadtree data structure. Quadtree is a tree data structure similar to a binary tree with the difference that each node could have up to four children instead of two. In this implementation each node either has four children or no children. The first node in the tree forms the initial plane. Each node in the tree represents a square and its four children represent the division of the square into four quadrants. Squares are added to the tree by recursively dividing squares into four quadrants.

This image from Wikipedia shows how an image is represented using a QuadTree: quadImage

QuadTree Wikipedia

Road network and coordinate generation

Each node in the tree represents a square in a plane. For a given number n of nodes, the squares are randomly divided into four quadrants, i.e. add four children to leaf nodes in the QuadTree. Each edge of the square forms a road connecting two points. The Point class represents a point in the 2 dimensional space. The Point class implements Python’s standard comparison, hash methods and also a method to calculate euclidean distance to another point in the same plane. Once the desired number of squares are generated, the tree is recursively traversed to generate Points based on the box formed by the squares in the tree. From these Points a list of edges are generated and the euclidean distance between them are calculated. Additionally, there are utility methods to perform Breadth First Search, add nodes to specific nodes in the tree and print statistics. To visualize the generated road network there is a utility to plot the network using Matplotlib

License: MIT License

[Eis10] David Eisenstat. “Random road networks: the quadtree model”. In: CoRR abs/1008.4916 (2010). url: http://arxiv.org/abs/1008.4916.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].