Skip to content

Latest commit

 

History

History
75 lines (47 loc) · 1.73 KB

File metadata and controls

75 lines (47 loc) · 1.73 KB

Greedy Algorithm for Project Selection (Python)

A Python implementation of the Greedy Algorithm to solve a real-world project selection and time optimization problem. This project demonstrates how to maximize profit under time constraints using different greedy strategies.

problem statement

Given a list of freelance projects with:

  • Required hours
  • Payment (fee)

Select the optimal combination of projects within a 40-hour work limit to maximize total earnings


features

  • Object-Oriented Design using a Project class

  • Multiple Greedy Strategy Implementations:

    • 💰 Maximize total fee
    • ⏱️ Minimize time (more tasks)
    • 📊 Maximize profit per hour (efficiency)
  • Dynamic project sorting using custom lambda functions

  • Clean and reusable Python code


algorithms & concepts used

  • Greedy Algorithms
  • Sorting with Custom Key Functions
  • Time Complexity Optimization
  • Basic Scheduling Problem
  • Profit Maximization Strategy

use cases

  • Freelancers optimizing workload
  • Task scheduling systems
  • Resource allocation problems
  • Introductory algorithm learning (CS students)

how to run

python main.py

output

displays:

  • selected projects
  • individual project fees & hours
  • total profit for each greedy strategy

keywords

greedy algorithm python, project scheduling problem, profit maximization, python optimization project, algorithmic trading basics, task allocation python, time management algorithm, knapsack greedy approach


conclusion

This project highlights how different greedy strategies lead to different outcomes, and why choosing the right heuristic (like fee/hour) is crucial for optimal decision-making