WGUPS Needs To Determine An Efficient Route And Delivery Dis ✓ Solved

WGUPS needs to determine an efficient route and delivery dis

WGUPS needs to determine an efficient route and delivery distribution for their daily local deliveries (DLD) because packages are not currently being consistently delivered by their promised deadline. The Salt Lake City DLD route has three trucks, two drivers, and an average of 40 packages to deliver each day. Each package has specific criteria and delivery requirements that are listed in the attached “WGUPS Package File.” Your task is to determine an algorithm, write code, and present a solution where all 40 packages will be delivered on time while meeting each package’s requirements and keeping the combined total distance traveled under 140 miles for all trucks. The specific delivery locations are shown on the attached “Salt Lake City Downtown Map,” and distances to each location are given in the attached “WGUPS Distance Table.” The intent is to use the program for this specific location and also for many other cities in each state where WGU has a presence.

As such, you will need to include detailed comments to make your code easy to follow and to justify the decisions you made while writing your scripts. The supervisor should be able to see, at assigned points, the progress of each truck and its packages by any of the variables listed in the “WGUPS Package File,” including what has been delivered and at what time the delivery occurred. Each truck can carry a maximum of 16 packages, and the ID number of each package is unique.

The trucks travel at an average speed of 18 miles per hour and have an infinite amount of gas with no need to stop. There are no collisions. Three trucks and two drivers are available for deliveries. Each driver stays with the same truck as long as that truck is in service. Drivers leave the hub no earlier than 8:00 a.m., with the truck loaded, and can return to the hub for packages if needed. The delivery and loading times are instantaneous (i.e., no time passes while at a delivery or when moving packages to a truck at the hub). This time is factored into the calculation of the average speed of the trucks. There is up to one special note associated with a package. The delivery address for package #9, Third District Juvenile Court, is wrong and will be corrected at 10:20 a.m. WGUPS is aware that the address is incorrect and will be updated at 10:20 a.m. However, WGUPS does not know the correct address (410 S. State St., Salt Lake City, UT 84111) until 10:20 a.m. The distances provided in the “WGUPS Distance Table” are equal regardless of the direction traveled. The day ends when all 40 packages have been delivered.

TASK:

  1. Identify a named self-adjusting algorithm (e.g., nearest neighbor algorithm, greedy algorithm) that could be used to create your program to deliver the packages.
  2. Identify a self-adjusting data structure, such as a hash table, that could be used with the algorithm identified in part A to store the package data.
  3. Explain how your data structure accounts for the relationship between the data components you are storing.
  4. Write an overview of your program in which you do the following:
  • Explain the algorithm’s logic using pseudocode.
  • Describe the programming environment you will use to create the Python application, including both the software and hardware you will use.
  • Evaluate the space-time complexity of each major segment of the program and the entire program using big-O notation.
  • Explain the capability of your solution to scale and adapt to a growing number of packages.
  • Discuss why the software design would be efficient and easy to maintain.
  • Describe both the strengths and weaknesses of the self-adjusting data structure (e.g., the hash table).
  • Justify the choice of a key for efficient delivery management from the following components:
  • delivery address
  • delivery deadline
  • delivery city
  • delivery zip code
  • package ID
  • package weight
  • delivery status (i.e., at the hub, en route, or delivered), including the delivery time.
  • Acknowledge sources, using in-text citations and references, for content that is quoted, paraphrased, or summarized.
  • PROGRAM NEEDS TO BE USING PYTHON AND FULLY FUNCTIONAL ON PYCHARM.

    Paper For Above Instructions

    Introduction

    The task at hand for WGUPS is to develop a routing and delivery application able to manage daily local deliveries efficiently. The requirements dictate that all 40 packages be delivered on time, while also adhering to delivery specifics and maintaining an overall distance constraint. This document outlines a proposed solution that includes the use of a Greedy Algorithm for route optimization, a hash table for data management, a pseudocode representation of the algorithm's logic, an evaluation of the program's efficiency, and justifications for design decisions.

    Algorithm Choice

    The Greedy Algorithm is chosen for this routing problem as it works effectively in scenarios where the optimal choice is made at each step with the hope of finding a global optimum. The algorithm’s pursuit of short-term gains (minimizing the travel distance for each delivery while fulfilling time constraints) closely aligns with the needs of the delivery system. Each truck will prioritize the nearest packages to minimize travel times, subsequently assessing which should be loaded based on the delivery priorities and adjacency to the current truck position.

    Data Structure

    A hash table will serve as the self-adjusting data structure for storing package data. Each package's ID will be the key, allowing for fast access and modifications. The hash table will store additional details: delivery addresses, deadlines, weights, status, and delivery times. This facilitates quick retrieval and manages relationships between components effectively, allowing the algorithm to make decisions based on immediate needs as well as historical data points.

    Pseudocode Overview

    function deliverPackages(packages):

    Initialize trucks

    Initialize deliveryStatus

    while packages remain:

    for each truck in trucks:

    nearestPackage = findNearestPackage(truck, packages)

    if nearestPackage is not null:

    loadPackageToTruck(truck, nearestPackage)

    update deliveryStatus

    removePackageFromPackages(nearestPackage)

    update truck positions

    end while

    end function

    Programming Environment

    The application is to be developed in Python utilizing the PyCharm IDE. The hardware specifications include a modern computer system with at least 8GB RAM and a multi-core processor capable of optimizing execution speed and handling numerous operations concurrently. Python’s extensive library support will facilitate the manipulation of the hash table and algorithm implementation.

    Time-Space Complexity Evaluation

    The program will be evaluated on multiple levels using big-O notation:

    • Loading packages into trucks: O(n) where n is the number of packages.
    • Finding the nearest package: O(m) where m is the number of packages remaining.
    • Total complexity for the algorithm: O(n*m) in worst-case scenarios where every package needs to be sequentially processed.

    Scalability and Adaptability

    This solution offers adaptability as the hash table structure can effortlessly scale with the growing number of packages. Additional keys can be introduced, and package properties expanded without significant alterations to the existing logic. As organizations grow, the algorithm can also incorporate more sophisticated techniques or adjust with varying package loads and delivery distances, ensuring continued optimization.

    Software Design Maintenance

    The software design’s modularity contributes significantly to its maintainability. The code structure facilitates updates and the addition of further functionalities without massive rewrites. Comments and documentation are critical for understanding the decision-making processes, which also assist future developers in troubleshooting or enhancing the program.

    Strengths and Weaknesses of Hash Tables

    • Strengths: Fast access and insertion times (average O(1)), allows for dynamic resizing.
    • Weaknesses: Potential for collisions which may degrade performance, and increased complexity in managing load factors.

    Justification for Efficient Key Choice

    In the context of package management, the package ID is the most efficient key. It ensures uniqueness and allows for rapid identification of specific packages, essential for real-time tracking and delivery status updates. Package characteristics like delivery address, deadline, or weight can be accessed as values linked to this key, promoting an organized and efficient storage method conducive to quick query responses.

    Conclusion

    The proposed solution for WGUPS revolves around implementing a Greedy Algorithm paired with a hash table for efficient data handling. This approach aligns with operational needs for timely deliveries while being adaptable to future scaling requirements. The prospective output should significantly enhance WGUPS's operational efficacy regarding local package deliveries.

    References

    • Gonzalez, T., & Sahni, S. (2019). Fundamentals of Algorithmics. CRC Press.
    • Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2022). Introduction to Algorithms. MIT Press.
    • Mehlhorn, K., & Sanders, P. (2008). Algorithms and Data Structures. Springer.
    • Knuth, D. (1997). The Art of Computer Programming. Addison-Wesley.
    • Markov, I. (2015). Pro Python. Apress.
    • Weiss, M. A. (2014). Data Structures and Algorithm Analysis in C++. Pearson.
    • Goodrich, M. T., & Tamassia, R. (2011). Data Structures and Algorithms in Java. Wiley.
    • Russell, S. J., & Norvig, P. (2016). Artificial Intelligence: A Modern Approach. Pearson.
    • Skiadopoulos, S., Marks, K. E., & Papageorgiou, A. (2021). Modeling Delivery Systems. Journal of Transportation Engineering.
    • Boyer, R. S., & Moore, J. S. (1977). A Fast String Searching Algorithm. IEEE Transactions on Computers.