How vinhthaitong/3345-assignment4 works
Project type and purpose
• This is a stand-alone, command-line Java application (“Flight Path Finder”) that models a flight network as a directed, weighted graph.
• It ingests two data files (FlightData.txt and Input.txt), builds an in-memory graph, performs a full DFS to enumerate all acyclic paths between two airports, sorts by cost or time, and prints human-readable results.
File structure
• Top-level Java classes:
• Main.java – application entry point, coordinates I/O, graph construction, search, and output
• Graph.java – holds adjacency-list representation; implements DFS logic for “all-paths” search
• Node.java – data model for a graph vertex (airport) and outgoing edges
• Path.java – data model for a candidate route, accumulates cost & time
• Data files:
• FlightData.txt – source data for graph edges (source|dest|cost|time)
• Input.txt – list of trip requests (source|dest|C or T)
• No external frameworks; plain Java 11+ with recursive DFS.
Key insights from the README
• The core algorithm is depth-first search over a directed weighted graph.
• The project is extremely modular around these concerns:
• Data ingestion
• Graph construction
• Search & path storage
• Sorting / selection of optimal metrics
• Console rendering
Components
a. Data Sources Layer
• FlightData.txt (edge definitions)
• Input.txt (search requests)
b. I/O & Controller Layer
• Main.java
– Reads both files
– Instantiates Graph
– Parses requests & dispatches to search
– Receives results & forwards to output
c. Graph Model Layer
• Graph.java
• Node.java
• Path.java
d. Algorithm & Processing Layer
• DFS engine (recursive calls inside Graph.java)
• Path accumulator (Path.java instances)
• Sorter / comparator (cost vs time)
e. Output Layer
• Console renderer in Main.java (prints summary, all paths, best paths)
Relationships & data flow
• Controller → calls Graph.DFS → produces a collection of Path objects
• Collection → Sorter → picks cheapest/fastest
• Final results → Console Output
Architectural patterns & principles
• Single-process monolith with clear separation of concerns
• Layered structure: I/O → Domain model → Algorithm → Presentation
• Data models (Node, Path) are plain old Java objects (POJOs)
• Algorithm encapsulated inside Graph class
Technologies & libraries
• Java 11+ / OpenJDK 17
• No external dependencies
• Recursive DFS on adjacency lists