Combinatorial Optimization Course Project, Dr. Farnaz Hooshmand Khaligh
Maryam Sadeghi, Ali Mehrabi
Amirkabir University of Technology, Spring 2023
This project requires
numpy
,pnadas
,prettytable
,pyomo
andglpk
solver. You can install them using$ conda install numpy pandas prettytable $ conda install -c conda-forge pyomo glpk
A faculty has
We propose two different approaches in. defining satisfaction. The first approach is to model satisfaction as a mathematical function. This will provide a quantitative measure for the concept. We provide three objective functions for this approach. We then introduce a new approach for measuring satisfaction as minimizing allocations that are less preferred. We model this type of behavior as soft constraints.
First, we will write common model components and then build on them in later sections.
$\mathbb{I} = \set{1,\dots,n}$ : The set of professors.
$\mathbb{J} = \set{1,\dots,m}$ : The set of students.
$p_{i,j} \in \set{1,\dots,m}$ (Integer) : The score of professor$i$ to student$j$ .
$q_{i,j} \in \set{1,\dots,n}$ (Integer) : The score of student$j$ to professor$i$ .
$Cap_i$ (Integer) : Research capacity of professor$i$
$$\delta_{i,j} = \begin{cases} 1 & : \text{ if professor } i \text{ and student } j \text{ work together} \newline 0 & : \text{ o.w.}\end{cases}.$$
- Research capacity constraint: No professor shall supervise more students than their research capacity.
$$ \sum_j \delta_{i,j} \leq Cap_i \hspace{1cm} \forall i\in \mathbb{I}$$
- Single professor per student constraint: Each students must be supervised by exactly one professor.
$$\sum_i \delta_{i,j} =1 \hspace{1cm} \forall j\in \mathbb{J}$$
The main point of this project is constructing a decent enough objective function that maximizes satisfaction is the system. In other words, turning "satisfaction" into a mathematical expression is what we have worked on.
In this approach, the objective function itself is defined as follows and everything else will take effect within
We began by defining two main aspects of allocation.
- Total points: We would like to maximize the total points that students and professors have given to each other.
- Difference: We would like to minimize the difference between
$p_{i,j}$ and$q_{i,j}$ .
With the two aspects above, we introduce the following expression.
The result is quite promising. We can observe that the model tries to choose as best pairs as possible.
The quality of allocation, based on the data, seems decent; but we decided to try a few more expressions. We first tried a concept that we call professor/student score. These are calculated as follows.
Using the above concepts, we then introduce the following expression.
We then obtained the following results.
This was to allocate more popular students with more popular professors. Meaning, if two scores are equal in two allocations, then professor and student scores will determine the decision and the model will prioritize the more popular professor and allocate the student to them. As a result, we can see improvements in columns 1, 6 and 9, but there was also worse allocations in columns 12 and 14. However, the trade off is reasonable since pairs
We also went further and introduced another extension to this expression. This was in order to prioritize allocations where either
We then extended the expression in the following way.
Even though the last objective function has a slight advantage over the previous one, (pair (2, 1) is an improvement but (2, 3) is a deterioration) the improvement is not significant.
One way to model satisfaction is not to directly model it as means of maximizing score, but write the model in a way that minimizes worse allocations and if not successful, receive a penalty. We implemented this behavior in terms of soft constraints. We propose the following objective function along with two soft constraints to simulate this concept.
In this constraint we ensure that for all students that are allocated to a professor (i.e. professor
Therefore, upon violation,
Consider
- The student
$j^\prime$ will be allocated to the same professor. This term is crucial if we want to write a general model that works on non heterogenous attributes for the professors or the students. i.e. dynamic capacity for the professors - The student
$j^\prime$ is allocates to another professor (i.e. professor$i^\prime$ ) who prioritizes student$j^\prime$ over student$j$ . In other words,$p_{i^{'}, j^{'} }\le p_{i, j^{'}}$
We linearize this constraint as follows. Note that because of (Constraint 2), the right hand side of the above implication is either 0 or 1. therefore,
We then penalize its violation by adding an integer variable to the left hand side of the constraint. Like (Soft Constraint 1), we can conduct that
Using the proposed model, we obtain the following results. As we can see this approach achieves some improvement over the previous one. It can be seen that the number of (1,1) pairs has increased at the cost of the increase of some worse pair allocations.
Satisfaction as a qualitative concept can be quantized using many techniques. We propose several approaches to this and compared the performance and accuracy of the models. As a result, we noticed that defining satisfaction in terms of constraint violation rate will result in better allocation quality on the sample data. We plan on further improving this project by modeling the problem as a multi-objective problem where we will find a feasible solution and solve upon that.