Code Monkey home page Code Monkey logo

optimize's Introduction

Optimizing Resource Allocation with Mixed Integer Linear Programming, using similarity scores generated from language model as decision variable

Overview

This project aimed to optimize the allocation of workers to projects based on various attributes and constraints. It utilizes pre-trained language model ("all-MiniLM-L6-v2") to process certain text data to calculate similarity scores for use as a one of the decision variables in the optimization step ("PuLP"). There are two main scripts:

  • Part A: Analyzes worker and project attributes, generate embeddings with pre-trained language model, calculates scores, and create an output file.
  • Part B: Utilizes the output from Part A to optimize the assignment of workers to projects using Mixed Integer Linear Programming that involves maximizing an objective function.

Packages

  • Pandas
  • NumPy
  • Openpyxl
  • Pulp
  • Tkinter
  • Scikit-learn
  • Sentence Transformers
  • Transformers
  • Scipy
  • Torch

Features

  • Input Processing: Reads input data from various sheets in Excel file and preprocesses it for analysis.
  • Score Calculation: Calculates scores based on worker-project attributes and preferences.
  • Optimization: Utilizes linear programming to optimize the assignment of workers to projects while considering various constraints.
  • Output Generation: Generates detailed output files containing assignment information and overview tables.

Installation

  1. Clone the repository:
    git clone https://github.com/SummerCo0L/optimize.git
    cd "local_path_to_ur_project"/optimize
    
  2. Install the required dependencies:
    pip install -r requirements.txt
    
  3. Use Transformers offline by downloading the files ahead of time
    python setup.py
    

Usage

  1. Run Part A script to process input data and generate output:

    python Part_A_Script.py
    
  2. Run Part B script to optimize worker-project assignments:

    python Part_B_Script.py
    
  3. Sample Dataset: You can find a sample dataset in the data/input directory of this repository. The file is named Sample_Dataset.xlsx.

  4. Generated Outputs: The outputs of the scripts will be generated in the data/outputs directory. After running the scripts, you can find the output files in this directory. I've provided some samples for your reference.

Customizing Weight Values

Users have the flexibility to customize weight values for different decision variables directly within the Excel input file. These weight values can be adjusted according to specific preferences or requirements.

Note: The total sum of weight values for all decision variables should equal 1.

To modify the weight values:

  1. Open the input Excel file located at data/input/Sample_Dataset.xlsx.
  2. Navigate to the relevant sheet ("Weightage").
  3. Update the cell values according to your preferences, ensuring that the total sum equals 1.
  4. Save the changes to the Excel file.

Part_B script (optimization step) will take into account the updated weight values for generating the final allocation solution.

optimize's People

Contributors

summerco0l avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.