Skip to content

DorianPRJ7/Bentley-Ottmann-PS3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segment Intersection Detection — C / Bentley–Ottmann Algorithm

Description

Project developed in C using CLion, as part of the first-semester synthesis project for the Bachelor’s Degree in Computer Science (Year 2) at the University of Lorraine.
The objective was to implement and compare two approaches for detecting segment intersections in a 2D plane:

  1. A simple greedy algorithm
  2. The Bentley–Ottmann algorithm, optimized through the plane sweep technique

Implementation

The project involved the complete implementation of the required data structures, including:

  • Doubly linked lists
  • Binary search trees
  • Rational numbers, points, and segments

Each module and algorithm was validated through unit tests in C, with selected cases visualized in GeoGebra for verification and illustration.

Performance Analysis

Performance was analyzed both:

  • Theoretically, through asymptotic time complexity analysis, and
  • Experimentally, using Bash scripts that:
    • Generated random instances
    • Automatically executed both algorithms on each dataset
    • Stored and logged results in dedicated output files

The collected data was later processed and visualized in Excel, with charts comparing execution times across varying instance sizes.

Visualization

A JavaFX interface (provided), connected via JNI (Java Native Interface), allows real-time visualization of segments and their intersection points.

Learning Objectives

This project provided experience in:

  • Algorithmic design and complexity analysis
  • Memory management and low-level programming
  • Experimental performance evaluation
  • Data visualization and automated testing
  • Collaborative development using Git

University project completed as part of the first-semester synthesis project — Licence 2 Informatique, University of Lorraine.

About

Development of the Bentley-Ottmann algorithm and a Glutton algorithm for detecting segments on a 2D plane in C with CLion.

Topics

Resources

Stars

Watchers

Forks

Contributors