This repository contains a Python implementation of the Program Evaluation and Review Technique (PERT), a widely used tool in project management for planning and scheduling tasks. We made this work for the subject of optimization for business analytics in order to analyze and understand the method and to be able to calculate an example.
The PERT analysis tool calculates several key metrics for project management, including:
- Expected time for task completion.
- Variance of the time estimates.
- Earliest and latest start times for each task.
- Earliest and latest finish times for each task.
- Slack time for each task, indicating the flexibility in scheduling.
- Define your tasks and their optimistic (o), pessimistic (p), and most likely (m) time estimates.
- Define the dependencies between the tasks.
- Run the
pert
function to get the analysis results. - The
Pert.py
file is intended to be a comprehensive example. - Running
pert
inPert-Interactive.py
allows you to customize your tasks, the quantity of tasks and the dependencies.
Run in the command line
pip install pandas
Pandas is necessary to run the files in this respository
brew install graphviz
graphviz is required to create the graph within this repository
import math
import pandas as pd
def pert(tasks, dependencies):
# ... [Include the entire PERT function code here]
# Example usage
tasks = {
# This dictionary is set to blank. When running the program, python will
# ask you to complete this information in the command line
}
dependencies = {
# This dictionary is set to blank. When running the program, python will
# ask you to complete this information in the command line
}
results = pert(tasks, dependencies)
#Print the results
results_df = pd.DataFrame.from_dict(results, orient='index')
print(results_df)
import math
import pandas as pd
def pert(tasks, dependencies):
# ... [Include the entire PERT function code here]
# Example usage
tasks = {
"A": (3, 7, 5),
"B": (2, 6, 4),
# ... [Rest of your tasks]
}
dependencies = {
"A": [],
"B": [],
# ... [Rest of your dependencies]
}
results = pert(tasks, dependencies)
#Print the results
results_df = pd.DataFrame.from_dict(results, orient='index')
print(results_df)
Contributions to improve this tool are welcome. Feel free to fork this repository and submit your pull requests.