An open API service indexing awesome lists of open source software.

https://github.com/shgnplaatjies/verticaladjacenciesusinglinesweeping

A program to find vertical adjacencies in a list of non-overlapping orthogonal rectangles using line sweeping to generate an event point schedule.
https://github.com/shgnplaatjies/verticaladjacenciesusinglinesweeping

Last synced: 29 days ago
JSON representation

A program to find vertical adjacencies in a list of non-overlapping orthogonal rectangles using line sweeping to generate an event point schedule.

Awesome Lists containing this project

README

        

# Vertical Adjacencies using Line Sweeping

This repository contains Python scripts for generating data, computing vertical adjacencies of rectangles using a brute force approach, and measuring the performance of the algorithm.

## Contents

- `graph_gen.py`: Generates sample data of rectangles and saves the results in CSV files.
- `rectangledata.py`: Generates rectangles data for testing.
- `brute_force.py`: Implements a brute force approach to compute vertical adjacencies between rectangles.
- `timings.csv`: Stores the timing results of the algorithm for different input sizes.
- `adjacencies.csv`: Stores the computed vertical adjacencies of rectangles for different input sizes.
- `rectangles.csv`: Stores the generated rectangles data for different input sizes.

## Usage

### 1. Generate Sample Data

To generate sample data for testing, run the following command:

```bash
python graph_gen.py
```

### 2. Compute Vertical Adjacencies

To compute vertical adjacencies using a brute force approach, execute the following command:

```bash
python brute_force.py
```

### 3. Analyze Performance

The performance of the algorithm is measured and stored in `timings.csv`. You can analyze the timing results to understand the algorithm's efficiency.

## Dependencies

- Python 3.x
- NumPy
- Matplotlib
- CSV module

## Research:

![image](https://github.com/shgnplaatjies/Vertical-Adjacencies-using-Line-Sweeping/assets/63879125/02c3bcd4-4f0d-4694-b0b9-dff67854e58c)
![image](https://github.com/shgnplaatjies/Vertical-Adjacencies-using-Line-Sweeping/assets/63879125/510fed4f-919f-4190-b5af-f15127cedc8b)
![image](https://github.com/shgnplaatjies/Vertical-Adjacencies-using-Line-Sweeping/assets/63879125/c7a6e89d-2a53-4a3d-b560-e22df77992e6)