Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

air-control

Java Build Data

An air route optimizer written in Java that reads ANAC CSV datasets, builds a graph of airports and flights, identifies the main structural hubs, and finds the best time-aware route between two airports using Dijkstra.

Table of Contents

What This Project Does

The project implements a command-line application for planning routes in the Brazilian air network.

  • Main.java coordinates user interaction, loads the data, and runs route queries.
  • DataManager.java reads the files in T2_Dados/ and builds the graph.
  • Graph.java stores airports and flights, calculates the top 5 hubs, and runs the temporal Dijkstra search.
  • Route.java displays the resulting route with segments, airlines, aircraft, and waiting times.
  • TimeUtils.java converts dates and times to absolute minutes and formats the output.

Main characteristics:

  • Reads airports, airlines, aircraft, and flights from CSV files.
  • Automatically computes structural hubs from the graph's total degree.
  • Performs route search with time-based connection constraints.
  • Optionally simulates the closure of a hub to assess connectivity impact.
  • Prints a detailed itinerary in the terminal, segment by segment.

Why This Project Is Useful

This repository is useful if you want to:

  • Study a complete Java graph implementation applied to air logistics.
  • Understand how real flight data can be organized for time-aware queries.
  • See Dijkstra adapted for schedules, minimum connection times, and multiple layovers.
  • Experiment with a network-analysis flow that includes hubs and airport-unavailability simulation.

Architecture Overview

The system is divided into four main blocks:

  • Data ingestion:
  • Domain model:
  • Search engine:
    • Graph.java sorts flights, indexes departures, and runs the temporal Dijkstra search.
    • The graph also computes arrival, departure, and structural hub metrics.
  • Result presentation:
    • Route.java formats the final route in the terminal.
    • Main.java drives the interactive application loop.

Execution flow:

  1. Load airports, airlines, aircraft, and flights from the CSV files.
  2. Sort flights by origin and departure time.
  3. Compute the 5 airports with the highest total degree.
  4. Receive origin, destination, and departure date/time from the user.
  5. Optionally remove a hub for simulation.
  6. Run temporal Dijkstra and display the route.

Routing Rules

The algorithm works with absolute minutes starting from 01/03/2026 00:00 UTC.

  • Normal airports require a minimum connection time of 45 minutes.
  • Hubs require a minimum connection time of 60 minutes.
  • Airports marked as removed become inaccessible.
  • The search only considers flights that depart after the previous arrival time plus the minimum connection.
  • The final output shows total duration, layovers, and ground waiting time.

Getting Started

Prerequisites

  • Java 25
  • Maven 3.9 or later
  • A terminal capable of running Java applications

Run the application

From the repository root:

mvn compile
mvn exec:java -Dexec.mainClass="com.exemplo.Main"

Run the tests

mvn test

Data files

The files in T2_Dados/ must remain in the expected path, because loading happens directly from that folder.

Usage Examples

1) Query a standard route

When the application starts, provide:

  • Origin airport in ICAO format, for example SBPA.
  • Destination airport in ICAO format, for example SBGR.
  • Date and time in DD/MM/YYYY HH:MM format.

The program then computes the best sequence of flights and prints the detailed route in the terminal.

2) Simulate the closure of a hub

Before calculating a route, the application can temporarily remove one of the 5 structural hubs.

This lets you test how the network behaves when an important airport is no longer available.

3) Repeat queries without restarting

After each route, you can choose to calculate another one. The graph is restored between queries, so each new simulation starts from a clean network state.

Project Structure

.
├── pom.xml
├── README.md
├── src/
│   ├── main/
│   │   └── java/com/exemplo/
│   │       ├── Airport.java
│   │       ├── DataManager.java
│   │       ├── Flight.java
│   │       ├── Graph.java
│   │       ├── Main.java
│   │       ├── Route.java
│   │       └── TimeUtils.java
│   └── test/
│       └── java/com/exemplo/AppTest.java
└── T2_Dados/
    ├── aerodromos.csv
    ├── aeronaves.csv
    ├── cias.csv
    └── voos_mar2026.csv

Where To Get Help

  • Start with Main.java to understand the interactive flow.
  • Use DataManager.java to see how the CSV files are interpreted.
  • Consult Graph.java for hub calculation and temporal search details.
  • See Route.java to understand how output is formatted.

Maintainers

Maintainer:

About

System designed to calculate the most efficient flight itineraries within the Brazilian national airspace. The optimizer navigates complex, time-dependent flight schedules to find the fastest route between two cities while strictly adhering to aeronautical connection constraints.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages