Assignment #03
Name: Muhammad Hassan Sagheer.
ID: 41093
Subject: INTRO TO INFORMATION AND
COMMUNICATION TECHNOLOGY
Submitted to:
Ms. Maria Hanif
Question [CLO2]
You are a software developer working for a logistics company that needs to optimize the delivery
routes for its fleet of delivery trucks. The company wants to implement a system that will
calculate the shortest route for each truck to deliver packages to multiple destinations within a
city. The system must consider various constraints such as delivery time windows, truck capacity,
and traffic conditions. The city is represented as a graph where nodes are delivery points and
edges are roads connecting these points. Each delivery point has a specific time window during
which the package must be delivered. The trucks have a maximum capacity that cannot be
exceeded, and real-time traffic data will be provided to update the travel times between nodes.
Your task is to create a system that assigns delivery routes to each truck in such a way that all
packages are delivered within their respective time windows, the truck capacity is not exceeded,
and the total travel time is minimized.
Pseudocode: Write pseudocode for the algorithm that assigns delivery routes to trucks.
Algorithm: Develop a detailed algorithm to implement this system, specifying each step.
Flowchart: Create a flowchart diagram that visually represents the logic and flow of the
algorithm.
Pseudo code:
Gather Data: Collect information about delivery points, time windows, truck capacities, and
real-time traffic data.
Initialize Structures: Set up the necessary data structures to store and manage this
information.
Calculate Initial Routes: Use a simple algorithm to determine the initial routes for each
truck based on factors like distance and time constraints.
Adjust Routes for Traffic: Continuously monitor real-time traffic data and make
adjustments to the routes accordingly to avoid delays.
Check Constraints: Ensure that the routes adhere to truck capacities and time windows for
deliveries.
If Constraints Met: If the routes meet all constraints, proceed to finalize them.
If Constraints Not Met: If any constraints are not met, go back and tweak the routes to
address them.
Finalize Routes: Output the finalized routes for each truck, ensuring that all deliveries can
be made on time and within capacity.
End: Finish the process.
Algorithm:
Step 1: Start
Step 2: Input Data: Delivery Points, Time Windows, Truck Capacities, Traffic Data
Step 3: Initialize Data Structures Step
4: Calculate Initial Routes Using Shortest Path Algorithm
Step 5: Adjust Routes Based on Real-Time Traffic Data Step
6: Check Constraints: Capacity, Time Windows Step
7: Constraints Met? If yes then step 8 if no then step 7.
Step 8: Re-optimize Routes Considering Updated Data
Step 9: Output: Finalize Routes Step
10: End
Flowchart: