Skip to content

A Python-based optimization tool that efficiently allocates Stanford students to limited learning opportunities using Genetic Algorithms with a custom fitness function.

Notifications You must be signed in to change notification settings

justindachille/Trip-Optimization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Optimization Tool for Learning Opportunities

This project aims to optimize the allocation of Stanford University students to limited, discrete learning opportunities such as field trips. The tool employs various optimization techniques, including a custom Genetic Algorithm, to explore high-dimensional data spaces and find the global optimum while considering multiple constraints.

Features

  • Reads student preferences and trip information from a CSV file
  • Optimizes student allocation based on their preferences and trip capacities
  • Implements a custom Genetic Algorithm to efficiently explore the solution space
  • Supports multiple constraints, such as limiting the number of trips per student and ensuring EV trip allocation fairness
  • Generates output CSV files with the optimized allocation results
  • Provides detailed statistics on the allocation quality, such as the percentage of slots assigned to each preference level

Usage

  1. Prepare the input CSV file (spring_22_general.csv) with student preferences and trip information.
  2. Run the optimization script to allocate students to trips based on their preferences and constraints.
  3. The optimized allocation results will be saved in output CSV files (sample.csv and sample3.csv).
  4. Review the allocation statistics printed in the console to assess the quality of the allocation.

Optimization Techniques

The project employs the following optimization techniques:

  • Genetic Algorithm: A custom Genetic Algorithm is implemented to efficiently explore the high-dimensional solution space. The algorithm evolves a population of candidate solutions over multiple generations, applying selection, crossover, and mutation operations to find the global optimum.

  • Scoring Function: A scoring function is defined to evaluate the quality of each candidate solution. The function considers factors such as assigning students to their preferred trips, avoiding overallocation of trips, limiting the number of trips per student, and ensuring fairness in EV trip allocation.

  • Constraint Handling: The optimization process incorporates various constraints to ensure a fair and feasible allocation. These constraints include limiting the number of trips per student based on their registration units, restricting the number of EV trips per student, and avoiding overallocation of trips beyond their capacities.

Impact

This optimization tool has been in use since the Spring 2022 quarter at Stanford University. It has successfully automated the allocation process for limited learning opportunities, ensuring a fair and efficient distribution of students to field trips based on their preferences.

By employing advanced optimization techniques, the tool has significantly reduced the manual effort required for allocation while maximizing student satisfaction and adhering to various constraints. The detailed statistics generated by the tool provide valuable insights into the quality of the allocation, enabling continuous improvement and refinement of the process.

Dependencies

The project relies on the following dependencies:

  • Python 3.x
  • NumPy
  • Matplotlib
  • pygad (Genetic Algorithm library)

Please ensure that these dependencies are installed before running the optimization script.

Future Enhancements

The following enhancements can be considered for future iterations of the project:

  • Graphical User Interface (GUI) for easier input and visualization of results
  • Integration with a database for efficient storage and retrieval of student and trip data
  • Exploration of additional optimization techniques and algorithms to further improve the allocation quality
  • Incorporation of more advanced constraints and preferences to cater to specific requirements

Acknowledgements

We would like to thank the Stanford University administration and faculty for their support and collaboration in the development and implementation of this optimization tool. Their valuable feedback and insights have contributed to the success of this project.

About

A Python-based optimization tool that efficiently allocates Stanford students to limited learning opportunities using Genetic Algorithms with a custom fitness function.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published