31-07-2025 - Operations Research - Integer Linear Programming [EN]-[IT]

image.png


~~~ La versione in italiano inizia subito dopo la versione in inglese ~~~


ENGLISH

31-07-2025 - Operations Research - Integer Linear Programming [EN]-[IT]
With this post, I would like to provide a brief introduction to the topic in question.
(code notes: X_79)

Integer Linear Programming

image.png

Image created with artificial intelligence, the software used is Microsoft Copilot
Introduction
We've previously discussed linear programming in general. In this article, I'd like to delve into a specific topic in greater detail: integer linear programming.

Linear Programming
Linear programming (sometimes abbreviated as LP) is simply an optimization problem in which the objective is to maximize or minimize a linear function in the decision variables of the problem.
In linear programming, the set of feasible solutions is defined by a system of linear equations or inequalities in the decision variables (also called constraints).

Integer Linear Programming
An integer linear programming problem is a linear programming problem in which the variables are constrained to take integer values (i.e., in the set ℤ).

Linear Programming {0,1}
A programming {0,1} problem is a linear programming problem in which the variables are constrained to take binary values in the set {0,1} and represent the possibility of an event occurring or not.

Linear Programming Exercise {0,1}
A small company must decide whether to invest in three projects. Based on the rule that {0,1} represents the possibility of an event occurring or not, we assume that each project can be approved (1) or postponed (0). Let's imagine that the projects have an estimated cost and profit. The available budget is 5 units.
We then introduce the cost and profit variables, meaning that each project will have a cost and a profit. For example, project 1 will have a cost of 2 and a profit of 3, project 2 will have a cost of 3 and a profit of 4, while project 3 will have a cost of 1 and a profit of 2.
In all of this, remember that we have a budget of 5.
... but let's not waste time talking... what is our goal? Let's always keep in mind that our goal is to maximize profit while respecting the budget constraint.

Procedure
Let's take the initial data and create a table.

image.png

We identify the decision variables as x1, x2, and x3, and they belong to {0,1}. Recall that 1 means project approval, and 0 means project non-approval.
What we just wrote mathematically translates as follows:

image.png

Our objective function will be to maximize Z based on the following request:

image.png

Where
3x1 = 3 (profit of project 1), x1 (project variable 1, which can be 0 or 1)

While our budget constraint will be mathematically expressed by the following inequality:

image.png

Where
2x1 = 2 (cost of project 1) x1 (variable of project 1, which can be 0 or 1)

Now we need to examine all the possibilities, and in this case we can write everything in a table.

image.png

Let's take an example with the 4th row:
We have x1 as 0, while x2 and x3 are set to 1, so in the cost column we have that the cost will be that of x2 + x3, i.e., 4, while the profit will be the sum of the profits of project 2 and project 3, i.e., 6. Remember that the admissible solutions are those with a budget less than or equal to 5.
If we check, there is only one solution that has a cost greater than 5, and it is the last solution with all the approved projects, i.e., with x1, x2, and x3 all set to 5. 1.

Optimal Solution
Our optimal solution will be the one that generates the greatest profit while respecting the budget constraint.
According to the table, the solution with x1=1, x2=2, and x3=0 yields a maximum profit of 7 and satisfies the budget constraint (less than or equal to 0).
Below is the table indicating the optimal solution.

image.png

Conclusions
Linear programming {0,1} is a form of combinatorial optimization in which the decision variables can take only two values, 1 or 0. This type of programming is perfect for helping decision-making in problems where decisions are of the yes/no or true/false type.

Question
Several mathematical minds have contributed to linear programming {0,1} in the past, but an undisputed pioneer was Soviet scientist Leonid Kantorovich. Did you know that Kantorovich introduced the first concepts of linear programming for economic planning in 1939? Did you also know that Kantorovich won the Nobel Prize in Economics in 1975?



ITALIAN

31-07-2025 - Ricerca operativa - Programmazione Lineare Intera [EN]-[IT]
Con questo post vorrei dare una breve istruzione a riguardo dell’argomento citato in oggetto
(code notes: X_79)

Programmazione Lineare Intera

image.png

immagine creata con l’intelligenza artificiale, il software usato è Microsoft Copilot
Introduzione
Abbiamo parlato in precedenza di programmazione lineare in maniera generale. In questo articolo vorrei entrare più nel dettaglio soprattutto in un argomento particolare, la programmazione lineare intera.

Programmazione lineare
La programmazione lineare (a volte abbreviato come PL) non è altro che un problema di ottimizzazione in cui l’obiettivo è massimizzare o minimizzare una funzione lineare nelle variabili di decisione del problema.
Nella programmazione lineare l’insieme delle soluzioni ammissibili sono definite da un sistema di equazioni o disequazioni lineari nelle variabili di decisione (chiamate anche vincoli)

Programmazione lineare intera
Un problema di programmazione lineare intera è un problema di programmazione lineare in cui le variabili sono vincolate ad assumere valori interi (cioè nell’insieme ℤ)

Programmazione lineare {0,1}
Un problema di programmazione {0,1} è un problema di programmazione lineare in cui le variabili sono vincolate ad assumere valori binari nell’insieme {0,1} e rappresentano la possibilità che un evento si verifichi oppure no.

Esercizio di programmazione lineare {0,1}
Una piccola azienda dve decidere se investire in 3 progetti. Basandosi sulla regola che {0,1} rappresentano la possibilità che un evento si verifichi oppure no, pensiamo che ogni progetto possa essere approvato (1) o rimandato (0). Immaginiamo che i progetti abbiano un costo e un profitto stimato. Il budget disponibile è di 5 unità.
Quindi introduciamo le variabili di costo e profitto, cioè ogni progetto avrà un costo ed un profitto. Ad esempio il progetto 1 avrà un costo di 2 ed un profitto di 3, il progetto 2 avrà un costo di 3 ed un profitto di 4, mentre il progetto 3 avrà un costo di 1 ed un profitto di 2.
In tutto questo ricordiamo che abbiamo un budget di 5.
.. ma non perdiamoci in chiacchere.. qual è il nostro obiettivo? Teniamo sempre bene in mente che il nostro obiettivo è quello di massimizzare il profitto rispettando il vincolo di budget.

Svolgimento
Prendiamo i dati di partenza e costruiamo una tabella.

image.png

Le variabili decisionali le identifichiamo come x1,x2 e x3 ed appartengono a {0,1}, ricordiamo che 1 significa approvazione del progetto, 0 non approvazione del progetto.
Quello che abbiamo appena scritto matematicamente si traduce come segue:

image.png

La nostra funzione obiettivo sarà massimizzare Z in base alla seguente richiesta

image.png

Dove
3x1 = 3 (profitto del progetto 1), x1 (variabile del progetto 1 che può essere 0 oppure 1)

Mentre il nostro vincolo di budget sarà matematicamente espresso dalla seguente disequazione

image.png

Dove
2x1 = 2 (costo del progetto 1) x1 (variabile del progetto 1 che può essere 0 oppure 1)

Ora dobbiamo esaminare tutte le possibilità ed in questo caso possiamo scrivere tutto su una tabella.

image.png

Facciamo un esempio con la 4 riga:
Abbiamo che x1 è 0, mentre x2 e x3 sono impostate ad 1, quindi nella colonna dei costi abbiamo che il costo sarà quello di x2+x3, cioè 4, mentre il profitto sarà la somma del profitto del progetto 2 e del progetto 3, cioè 6. Ricordiamo che le soluzioni ammissibili sono quelle che hanno un budget minore o uguale a 5
Se andiamo a verificare c’è solo una soluzione che ha un costo superiore a 5 ed è l’ultima soluzione con tutti i progetti approvati, cioè con x1, x2 e x3 tutti impostati ad 1.

Soluzione ottima
La nostra soluzione ottimale sarà quella che genererà il maggior profitto rispettando appunto il vincolo di budget.
Secondo la tabella la soluzione con x1=1, x2=2 e x3=0 da un profitto massimo di 7 e rispetta appunto il vincolo di budget (minore o uguale 0)
Qui di seguito riporto la tabella con indicato la soluzione ottimale

image.png

Conclusioni
La programmazione lineare {0,1} è una forma di ottimizzazione combinatoria in cui le variabili decisionali possono assumere solo due valori, 1 o 0. Questa tipologia di programmazione è perfetta per aiutare a prendere delle decisioni in problemi in cui le decisioni sono del tipo si/no oppure vero/falso.

Domanda
Diverse menti matematiche in passato hanno dato il loro contributo alla programmazione lineare {0,1}, ma un indiscusso pioniere è stato il sovietico Leonid Kantorovich. Lo sapevate che Kantorovich introdusse nel 1939 i primi concetti di programmazione lineare per la pianificazione economica? Sapevate anche che Kantorovich prese anche un premio Nobel per l’economia nel 1975?

THE END



0
0
0.000
18 comments
avatar

Since 1939? That’s a long time ago
Sometimes, I wish to know when Mathematics was invented.
It must have been a long time ago

0
0
0.000
avatar

Thanks for leaving a comment. While I was writing this post, I realized I'd covered a difficult topic and explained it poorly. In short, the dual problem is an alternative and often more convenient way to analyze and solve a linear programming problem. I plan to try to explain it again in the future, trying to be clearer. !BEER

0
0
0.000
avatar

L'esempio mi è piaciuto, a scuola questo me lo avrebbero fatto risolvere con un sistema, quello con la graffa enorme

!PIZZA

0
0
0.000
avatar

Grazie per questa tue gentile parole. Mi è venuto in mente questo esempio di programmazione lineare intera ed ho cercato di spiegarlo nei dettagli, ma ho visto che potrei fare meglio. Credo che riproveró a farlo in maniera ancora più chiara !BEER

0
0
0.000
avatar

Congratulations @stefano.massari! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You have been a buzzy bee and published a post every day of the month.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Be ready for the August edition of the Hive Power Up Month!
Hive Power Up Day - August 1st 2025
0
0
0.000
avatar

Wow why did it actually take so much of time that it seems like it is not usable again any longer

0
0
0.000
avatar

Hi, thanks for the question, it is true that in 1939 the first concepts of linear programming emerged, but it is also true that they were taken up again immediately in the mid-40s by Dantzig who immediately brought these concepts to very high levels and were immediately applied in the military and industrial fields. !PIZZA

0
0
0.000
avatar

Congratulations @stefano.massari! You received a personal badge!

You powered-up at least 10 HIVE on Hive Power Up Day!
Wait until the end of Power Up Day to find out the size of your Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Month Challenge - July 2025 Winners List
Be ready for the August edition of the Hive Power Up Month!
Hive Power Up Day - August 1st 2025
0
0
0.000
avatar

Congratulations @stefano.massari! You received a personal badge!

You powered-up at least 100 HP on Hive Power Up Day! This entitles you to a level 3 badge
Participate in the next Power Up Day and try to power-up more HIVE to get a bigger Power-Bee.
May the Hive Power be with you!

You can view your badges on your board and compare yourself to others in the Ranking

Check out our last posts:

Hive Power Up Month Challenge - July 2025 Winners List
Be ready for the August edition of the Hive Power Up Month!
Hive Power Up Day - August 1st 2025
0
0
0.000