Quantcast
Channel: Yet Another Math Programming Consultant
Viewing all articles
Browse latest Browse all 809

A variant of an assignment problem

$
0
0

 In one [1], the following problem is sketched:

  • We have different types of workers. In the data set below, I call them type-A and type-B workers. 
  • We need to assign workers to jobs.
  • We have more workers than jobs, so we can execute all jobs. 
  • This is a standard assignment problem: \[\begin{align} \min &\sum_{w,j} \color{darkblue}c_{w,j} \color{darkred}x_{w,j}\\ & \sum_j \color{darkred}x_{w,j} \le 1 &&\forall w \\ & \sum_w \color{darkred}x_{w,j} = 1 && \forall j \\ & \color{darkred}x_{w,j} \in [0,1] \end{align}\]
  • The complication is that we can form teams of two workers, one of type A and one of type B. Such a team can work faster and execute the job in less time.
  • How to handle this?

I don't know how to handle this within an assignment problem, but stating this as a MIP allows us to make some progress. Allowing two persons to work on a job is easy. Just replace the second constraint by \[1 \le \sum_w \color{darkred}x_{w,j} \le 2\] Unfortunately this ignores that we need one worker of each type in a team. Also, this makes it difficult to impose a cost for each specific team.


As an alternative one could explicitly use teams in the model. Here is my data set with random costs:


----     13 SET iworkers+teams

a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10
b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8 , b9 , b10
team1 , team2 , team3 , team4 , team5 , team6 , team7 , team8 , team9 , team10
team11 , team12 , team13 , team14 , team15 , team16 , team17 , team18 , team19 , team20
team21 , team22 , team23 , team24 , team25 , team26 , team27 , team28 , team29 , team30
team31 , team32 , team33 , team34 , team35 , team36 , team37 , team38 , team39 , team40
team41 , team42 , team43 , team44 , team45 , team46 , team47 , team48 , team49 , team50
team51 , team52 , team53 , team54 , team55 , team56 , team57 , team58 , team59 , team60
team61 , team62 , team63 , team64 , team65 , team66 , team67 , team68 , team69 , team70
team71 , team72 , team73 , team74 , team75 , team76 , team77 , team78 , team79 , team80
team81 , team82 , team83 , team84 , team85 , team86 , team87 , team88 , team89 , team90
team91 , team92 , team93 , team94 , team95 , team96 , team97 , team98 , team99 , team100


---- 13 SET wworkers

a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10, b1 , b2 , b3 , b4 , b5
b6 , b7 , b8 , b9 , b10


---- 13 SET atype-A workers

a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9 , a10


---- 13 SET btype-B workers

b1 , b2 , b3 , b4 , b5 , b6 , b7 , b8 , b9 , b10


---- 13 SET tteams

team1 , team2 , team3 , team4 , team5 , team6 , team7 , team8 , team9 , team10
team11 , team12 , team13 , team14 , team15 , team16 , team17 , team18 , team19 , team20
team21 , team22 , team23 , team24 , team25 , team26 , team27 , team28 , team29 , team30
team31 , team32 , team33 , team34 , team35 , team36 , team37 , team38 , team39 , team40
team41 , team42 , team43 , team44 , team45 , team46 , team47 , team48 , team49 , team50
team51 , team52 , team53 , team54 , team55 , team56 , team57 , team58 , team59 , team60
team61 , team62 , team63 , team64 , team65 , team66 , team67 , team68 , team69 , team70
team71 , team72 , team73 , team74 , team75 , team76 , team77 , team78 , team79 , team80
team81 , team82 , team83 , team84 , team85 , team86 , team87 , team88 , team89 , team90
team91 , team92 , team93 , team94 , team95 , team96 , team97 , team98 , team99 , team100


---- 13 SET jjobs

job1 , job2 , job3 , job4 , job5 , job6 , job7 , job8 , job9 , job10, job11, job12
job13, job14, job15


---- 23 SET teamcomposition of teams

team1 .a1 , team1 .b1 , team2 .a1 , team2 .b2 , team3 .a1 , team3 .b3 , team4 .a1
team4 .b4 , team5 .a1 , team5 .b5 , team6 .a1 , team6 .b6 , team7 .a1 , team7 .b7
team8 .a1 , team8 .b8 , team9 .a1 , team9 .b9 , team10 .a1 , team10 .b10, team11 .a2
team11 .b1 , team12 .a2 , team12 .b2 , team13 .a2 , team13 .b3 , team14 .a2 , team14 .b4
team15 .a2 , team15 .b5 , team16 .a2 , team16 .b6 , team17 .a2 , team17 .b7 , team18 .a2
team18 .b8 , team19 .a2 , team19 .b9 , team20 .a2 , team20 .b10, team21 .a3 , team21 .b1
team22 .a3 , team22 .b2 , team23 .a3 , team23 .b3 , team24 .a3 , team24 .b4 , team25 .a3
team25 .b5 , team26 .a3 , team26 .b6 , team27 .a3 , team27 .b7 , team28 .a3 , team28 .b8
team29 .a3 , team29 .b9 , team30 .a3 , team30 .b10, team31 .a4 , team31 .b1 , team32 .a4
team32 .b2 , team33 .a4 , team33 .b3 , team34 .a4 , team34 .b4 , team35 .a4 , team35 .b5
team36 .a4 , team36 .b6 , team37 .a4 , team37 .b7 , team38 .a4 , team38 .b8 , team39 .a4
team39 .b9 , team40 .a4 , team40 .b10, team41 .a5 , team41 .b1 , team42 .a5 , team42 .b2
team43 .a5 , team43 .b3 , team44 .a5 , team44 .b4 , team45 .a5 , team45 .b5 , team46 .a5
team46 .b6 , team47 .a5 , team47 .b7 , team48 .a5 , team48 .b8 , team49 .a5 , team49 .b9
team50 .a5 , team50 .b10, team51 .a6 , team51 .b1 , team52 .a6 , team52 .b2 , team53 .a6
team53 .b3 , team54 .a6 , team54 .b4 , team55 .a6 , team55 .b5 , team56 .a6 , team56 .b6
team57 .a6 , team57 .b7 , team58 .a6 , team58 .b8 , team59 .a6 , team59 .b9 , team60 .a6
team60 .b10, team61 .a7 , team61 .b1 , team62 .a7 , team62 .b2 , team63 .a7 , team63 .b3
team64 .a7 , team64 .b4 , team65 .a7 , team65 .b5 , team66 .a7 , team66 .b6 , team67 .a7
team67 .b7 , team68 .a7 , team68 .b8 , team69 .a7 , team69 .b9 , team70 .a7 , team70 .b10
team71 .a8 , team71 .b1 , team72 .a8 , team72 .b2 , team73 .a8 , team73 .b3 , team74 .a8
team74 .b4 , team75 .a8 , team75 .b5 , team76 .a8 , team76 .b6 , team77 .a8 , team77 .b7
team78 .a8 , team78 .b8 , team79 .a8 , team79 .b9 , team80 .a8 , team80 .b10, team81 .a9
team81 .b1 , team82 .a9 , team82 .b2 , team83 .a9 , team83 .b3 , team84 .a9 , team84 .b4
team85 .a9 , team85 .b5 , team86 .a9 , team86 .b6 , team87 .a9 , team87 .b7 , team88 .a9
team88 .b8 , team89 .a9 , team89 .b9 , team90 .a9 , team90 .b10, team91 .a10, team91 .b1
team92 .a10, team92 .b2 , team93 .a10, team93 .b3 , team94 .a10, team94 .b4 , team95 .a10
team95 .b5 , team96 .a10, team96 .b6 , team97 .a10, team97 .b7 , team98 .a10, team98 .b8
team99 .a10, team99 .b9 , team100.a10, team100.b10


---- 28 PARAMETER ccost coefficients

job1 job2 job3 job4 job5 job6 job7 job8 job9

a1 17.17584.32755.03830.11429.22122.40534.98385.6276.711
a2 63.97215.95225.00866.89343.53635.97035.14413.14915.010
a3 11.04950.23816.01787.24626.51128.58159.39672.27262.825
a4 18.21064.57356.07576.99629.78166.11175.58262.74528.386
a5 7.27717.56652.56375.02117.8123.41458.51362.12338.936
a6 78.34030.00312.54874.8876.92320.2020.50726.96149.985
a7 99.36036.99037.28977.19839.66891.31011.95873.5485.542
a8 22.57539.61227.60115.23793.63242.26613.46638.60637.463
a9 10.16938.38932.40919.21311.23759.65651.1454.50778.310
a10 50.65915.92565.68952.38812.44098.67222.81267.56577.678
b1 73.4978.54415.03543.41918.69469.26976.29715.48138.938
b2 8.71254.04012.68673.40011.32348.83579.56049.20553.356
b3 2.46317.7826.1321.66483.56560.1662.70219.60995.071
b4 39.33480.54654.09939.07255.78293.27634.8770.82994.884
b5 58.03216.64264.33634.43191.23390.0061.62636.86366.438
b6 49.6624.49377.37053.29774.67772.00563.16011.49297.116
b7 79.07061.0225.43148.5185.25569.85819.47822.60381.364
b8 81.95386.04121.26945.6793.83632.30043.98831.53313.477
b9 6.44141.46034.16146.82964.26764.35833.76110.08290.583
b10 40.41911.16775.11380.3402.36648.08827.85990.1611.759
team1 50.42183.12660.2148.22557.77659.31868.37715.87733.178
team2 57.62471.98368.3731.98583.98071.00515.55161.07166.155
team3 1.2521.01795.20397.66896.63285.62814.1614.97355.303
team4 34.96811.73458.59844.55341.23291.45121.37822.41754.233
team5 31.0144.02082.11723.09641.00330.25844.49271.60059.315
team6 68.63967.46333.21375.99417.67868.24867.29983.12151.517
team7 8.46957.2162.20674.20490.51056.08247.28371.75651.301
team8 96.55295.78989.92332.75545.71059.61887.86217.06763.360
team9 33.62658.86457.43954.34257.81697.72232.14776.29796.251
team10 27.01675.84861.74329.10074.0700.77686.6511.51442.828
team11 93.34746.92821.36151.07836.57293.5406.80150.38739.241
team12 54.7485.82737.77297.40737.98215.62947.22639.70020.552
team13 7.21276.06529.01524.49543.59836.88155.3427.46690.944
team14 86.56897.53257.23831.39745.50337.10241.9858.53081.454
team15 44.43169.54767.66957.15417.35260.43558.59972.77824.623
team16 99.60246.44953.04919.03819.90664.49079.90858.63697.157
team17 0.30961.8020.66640.55865.62961.55026.3417.0454.597
team18 35.53533.78748.64925.93789.11984.93363.45298.64775.792
team19 60.35897.70555.40793.50441.32080.6450.07845.52641.917
team20 18.98742.80616.65188.62667.65486.3349.27699.64861.681
team21 44.19965.90648.44531.81991.40418.42387.21145.61045.892
team22 82.29448.05291.37692.92810.81135.06085.99834.05021.309
team23 29.67611.55039.97891.17625.15510.29814.63338.6304.641
team24 97.21524.34336.19763.03424.28510.10640.59347.90614.495
team25 72.04287.19529.95275.39084.37646.82365.49337.80535.887
team26 80.64973.26192.00133.16420.9784.71588.3049.28183.691
team27 57.99696.21151.41959.03056.7462.99096.89059.3755.962
team28 99.2955.53361.90880.44429.65995.89269.47563.14161.598
team29 35.58276.10813.63671.66396.37044.19226.44844.41839.670
team30 6.91093.85784.39795.04457.9383.52240.7435.74353.197
team31 18.61450.06893.88268.15718.52387.28816.50143.08377.173
team32 74.91464.76074.83852.31768.61169.10786.56579.57621.755
team33 32.48239.01229.93221.89682.17215.26695.0553.19273.446
team34 97.1089.63347.89272.21743.32015.81810.06680.55139.869
team35 90.91872.30916.63532.75558.13557.75462.7582.67312.942
team36 33.86122.42490.00382.93831.62295.22225.66962.61297.126
team37 59.51860.63863.36595.8248.22612.53760.52274.14884.752
team38 34.62140.95993.98660.29389.95428.47322.22457.48450.950
team39 75.58247.4917.6199.75032.96720.0619.07544.87746.281
team40 70.31587.49255.51325.56325.91835.51213.68880.70732.598
team41 40.71216.16286.17537.77188.86126.99877.73942.27942.985
team42 96.85127.00231.81588.33858.62238.20997.29867.08395.115
team43 11.83496.53884.35572.13396.44436.45776.83133.24854.208
team44 69.1565.47424.02088.27510.05867.83610.1384.28175.345
team45 18.59579.01686.45274.79338.94979.50462.09876.13758.026
team46 12.29161.78653.39514.40839.2281.47687.07724.55280.318
team47 3.95291.29354.25022.09992.55779.27873.93867.77450.119
team48 84.20265.73811.65127.4258.31650.53123.26879.85798.805
team49 34.05025.64199.30724.77912.14894.37125.32036.33539.410
team50 91.41819.24114.41476.03733.0580.01954.34353.50686.860
team51 34.19286.53746.08542.10672.58366.9599.29052.65989.543
team52 51.5182.49944.81850.12968.11979.90487.29528.29891.049
team53 1.81446.04162.39771.63633.5161.28835.62136.81791.687
team54 91.7033.81230.2387.00346.64956.07046.50954.73317.797
team55 70.7108.98340.81013.68373.46359.27735.7467.36863.081
team56 64.88012.22276.00463.31182.90190.88285.85696.6243.575
team57 28.70468.66227.52739.0289.47021.75684.35384.22688.356
team58 57.29533.57439.98452.03821.88070.11135.38930.44395.367
team59 13.34876.0509.41644.53779.38346.26132.45035.38917.424
team60 60.26629.78650.11548.84278.45262.11160.55880.20665.321
team61 48.29325.07648.48080.98851.94497.47310.24546.9951.720
team62 55.26288.31557.95178.82611.30965.8446.64189.80688.661
team63 83.95292.29823.66144.99427.2025.52996.6591.7751.772
team64 40.23190.44744.81734.87950.56139.5295.69471.67117.966
team65 18.09063.98414.54566.33213.19370.74257.0573.34128.519
team66 89.69286.51854.62132.15996.33591.0538.30163.8717.836
team67 70.98839.98521.74379.52572.17878.87542.39988.49665.532
team68 28.22039.85065.03028.16073.64966.88948.94035.90967.851
team69 15.37212.77586.77276.50457.89678.85689.68043.89658.892
team70 9.64825.85813.71329.32359.71768.81454.85516.83281.477
team71 19.76171.65731.43862.19147.63279.54052.10147.06161.375
team72 70.55457.88827.6083.98026.70623.41769.72896.83867.951
team73 25.74647.55787.61040.2298.16770.93285.33329.27527.718
team74 12.42219.26068.59379.72665.10446.90052.86951.10040.703
team75 21.64473.24557.38017.48022.51298.8578.09871.53571.020
team76 63.6990.91541.98451.11877.63769.81658.57056.03662.796
team77 25.20880.88381.77617.89587.6114.85236.31168.44971.587
team78 7.30677.86762.60817.97970.58444.2126.01752.78741.516
team79 90.69037.16686.20141.74528.67418.11461.10474.74984.652
team80 5.56619.2716.2174.9312.81259.61452.06645.39293.225
team81 10.01112.27156.49166.26986.98472.97070.64351.23866.539
team82 51.27936.20294.21785.48182.9295.23692.3376.47848.276
team83 30.50356.25138.43816.20268.00728.0494.74421.57775.036
team84 87.86427.18214.75618.2791.90664.28173.22256.71757.004
team85 73.60779.4754.99740.3724.53937.5618.75326.09045.468
team86 2.42432.72354.4122.8841.61642.87169.67929.67270.529
team87 41.06531.77450.93423.79926.39469.3869.29013.32010.917
team88 65.12528.14111.85929.77448.32125.05828.43681.41480.148
team89 72.42084.14467.92474.00952.94938.86229.61093.23681.799
team90 40.9645.39856.44913.81242.35854.71837.84556.76772.899
team91 29.23121.86251.14369.91156.02733.61651.87624.92241.096
team92 66.7647.57941.14151.8400.69018.66518.36154.36555.272
team93 36.44360.22483.94768.47988.23961.7479.94338.9102.983
team94 6.39612.78728.33291.48584.99321.96626.91746.70251.649
team95 29.60062.57993.92979.01234.29258.55760.67525.5883.830
team96 96.94557.3038.34134.51989.81254.27540.90132.75598.966
team97 5.72076.32787.03478.06117.19869.22963.38761.9130.038
team98 21.2778.25228.34197.28447.14622.19656.53789.96615.708
team99 77.38512.01578.86179.37583.14611.3793.41372.92588.689
team100 11.05020.27621.44827.92815.07376.67191.57494.4987.094

+ job10 job11 job12 job13 job14 job15

a1 50.02199.81257.87399.11376.22513.069
a2 58.91183.08923.08266.57377.58630.366
a3 46.38041.33111.77031.4214.65533.855
a4 8.64210.25164.12554.5313.15279.236
a5 35.87124.30324.64213.05093.34537.994
a6 15.12917.41733.06431.69132.20996.398
a7 57.6305.1410.60140.12351.98862.888
a8 26.84894.83718.89429.7517.45540.135
a9 94.57559.64660.73436.25159.40767.985
a10 93.24520.12429.71419.72324.63564.648
b1 69.54384.58161.27297.5972.68918.745
b2 1.06254.38745.11397.53318.38516.353
b3 33.55459.42625.91964.06315.52546.002
b4 57.19233.36398.37576.64611.00999.480
b5 59.3383.45784.18293.20850.79629.960
b6 70.67498.62785.48262.14470.13170.089
b7 99.17375.06771.8340.05926.38682.382
b8 81.09641.67914.17846.55328.29989.568
b9 21.73591.88745.1758.99337.42041.499
b10 68.10495.09190.01889.88087.44639.100
team1 31.58651.99336.37916.77668.30950.539
team2 19.43736.35262.39073.13941.39715.749
team3 18.40399.41780.90930.6218.74043.050
team4 63.10632.74314.87892.91525.1036.259
team5 13.11916.12531.56357.20626.8723.639
team6 28.30355.54241.3997.34180.60133.272
team7 88.70877.15214.01226.45268.25644.980
team8 77.15956.9452.76881.09927.89343.335
team9 94.89925.58932.49521.47917.39673.125
team10 35.86570.48741.58754.98034.50469.958
team11 20.48552.95558.90934.58025.28854.766
team12 62.7340.35550.3950.22352.13783.612
team13 4.87082.03679.29565.95439.17741.315
team14 50.92073.44282.43841.45392.44339.415
team15 14.20889.11944.27611.43290.36233.385
team16 49.10937.25482.71782.0873.13492.520
team17 16.02745.24816.88757.16085.8713.587
team18 50.78876.77783.21358.39457.50655.671
team19 1.5668.19859.88155.51861.80088.509
team20 0.07760.89417.37131.11972.8888.475
team21 12.41010.38023.48934.01687.30784.479
team22 92.63636.07387.59914.81445.59826.825
team23 2.63815.4007.27182.86439.97741.717
team24 50.96988.5285.54850.74076.41197.900
team25 25.44825.54845.06294.48533.5534.849
team26 46.3810.01715.65870.50328.03563.558
team27 54.41112.73642.04988.14571.65931.358
team28 52.30214.10383.67389.20969.64731.179
team29 36.69262.12685.97375.50190.08143.805
team30 11.24189.38524.16964.22429.07881.356
team31 97.80594.44624.88488.64688.44396.495
team32 58.96292.26260.2903.57091.11256.501
team33 11.04948.77536.10421.63992.37144.996
team34 11.70987.43514.48617.77454.52046.860
team35 6.41331.11057.85180.98067.92073.567
team36 96.20842.52810.5397.70864.41331.222
team37 35.24664.14189.57338.81727.34097.040
team38 55.74834.41739.82777.6232.82336.238
team39 81.19645.00095.42612.26440.66088.637
team40 42.8840.89622.42966.06728.74013.112
team41 24.90738.1777.09871.56370.2907.016
team42 71.82644.36087.97346.98146.38537.143
team43 13.84431.3677.98893.41549.42567.891
team44 98.7041.48414.68699.09813.2198.543
team45 66.3568.21456.68644.32332.82533.060
team46 8.40398.72255.82768.19285.95858.673
team47 43.11257.00811.10498.70151.94070.649
team48 32.50585.53778.99832.10921.28752.089
team49 83.63444.40092.63047.92190.38850.953
team50 45.45435.83311.38966.95493.8011.507
team51 99.01350.68664.45076.03090.60816.629
team52 45.08687.40121.6898.01370.52990.050
team53 99.01320.76935.03948.67664.3865.633
team54 38.19651.29295.65560.22945.48269.008
team55 77.60142.04880.74360.46565.90379.763
team56 96.2490.30711.84975.86025.55091.410
team57 15.02575.07452.29427.73862.18596.519
team58 20.16792.25846.87280.25233.4778.141
team59 98.77512.93614.74965.75916.31681.181
team60 45.92859.69697.95218.54498.21895.787
team61 30.61630.09328.04543.32650.26320.108
team62 73.26362.78736.5213.72172.86661.417
team63 14.84947.07372.49216.5418.85826.414
team64 62.30940.15211.72872.43071.5737.407
team65 40.58383.0849.44115.55290.33045.777
team66 33.25710.30325.40974.7209.08559.351
team67 76.15220.12335.18556.50276.92871.735
team68 34.54156.67380.03222.24742.67168.199
team69 83.58642.0606.9772.52085.09834.960
team70 55.37144.28216.56952.01582.6874.228
team71 81.40482.44350.15878.51273.53941.490
team72 59.11450.26865.87633.90325.40417.194
team73 17.48087.13627.0015.61557.78888.698
team74 53.11042.12356.28518.66375.41971.128
team75 56.39135.59448.2401.75090.26797.382
team76 99.21455.1623.34581.59387.44266.650
team77 46.95383.7491.1467.4894.97780.452
team78 45.7244.45047.4999.82329.86982.283
team79 39.59475.00288.49222.72382.52597.911
team80 81.16942.27975.64789.44011.41639.335
team81 64.25039.29949.81857.86496.40295.548
team82 94.84124.04011.9585.31859.96910.779
team83 92.9331.02681.71097.46478.84157.344
team84 36.4508.39569.40086.81236.59716.455
team85 71.75024.88430.63674.94679.26377.997
team86 99.36291.16846.24026.16859.7111.738
team87 83.33434.91688.32085.14625.04320.107
team88 2.64331.24924.75767.15283.60431.640
team89 99.15645.08144.85827.23088.12983.337
team90 65.14124.61058.16771.45918.80186.023
team91 51.62876.88666.3951.91690.86445.338
team92 40.15587.42862.17741.00727.3071.300
team93 58.29420.85740.27328.3081.95312.584
team94 2.41839.41967.58710.24237.15657.060
team95 67.27849.56638.35077.75589.9270.652
team96 4.01689.29730.99362.08517.33618.329
team97 21.72161.05846.02420.75350.34433.152
team98 29.13314.52785.9092.35584.51427.198
team99 26.20279.05463.52211.88352.11617.222
team100 81.17348.66046.72724.45584.13238.186


As I have 10 type-A workers and 10 type-B workers, we end up with 100 possible teams. As we can still use individual workers, our set \(i\) has \(10+10+10\times 10= 120\) elements. As you can see the model will quickly become rather large due to the enumeration of all possible teams.

My first thought was to add a side constraint to the assignment problem:


Assignment with side-constraint
\[\begin{align}\min&\sum_{i,j} \color{darkblue}c_{i,j}\color{darkred}x_{i,j}\\ & \sum_j \color{darkred}x_{i,j} \le 1 &&\forall i\\ & \sum_i \color{darkred}x_{i,j} = 1 &&\forall j \\ & \sum_j \left[\color{darkred}x_{w,j} + \sum_{t|\color{darkblue}{\mathit{team}}(t,w)} \color{darkred}x_{t,j} \right] \le 1 && \forall w \\ & \color{darkred}x_{i,j}\in \{0,1\}\end{align}\]


The last constraint says: a worker \(w\) can be used at most once, either individually or as part of a team. This problem is now a full-blown MIP as we can no longer assume that the decision variables \(\color{darkred}x_{i,j}\) are automatically integer-valued.

If we look at the model more carefully, we see that the last constraint implies the first constraint: any worker or any team can be used only once. That means we can drop the first constraint, and we end up with:


Final model
\[\begin{align}\min&\sum_{i,j} \color{darkblue}c_{i,j}\color{darkred}x_{i,j} \\ & \sum_j \left[\color{darkred}x_{w,j} + \sum_{t|\color{darkblue}{\mathit{team}}(t,w)} \color{darkred}x_{t,j} \right] \le 1 && \forall w \\ & \sum_i \color{darkred}x_{i,j} = 1 &&\forall j \\ & \color{darkred}x_{i,j}\in \{0,1\}\end{align}\]


Results


To obtain a reference point, I first solved the pure assignment problem using only individuals (no teams). This gave:


----    103 VARIABLE x.L  assignment

job1 job2 job3 job4 job5 job6 job7 job8 job9

a5 1
a6 1
b1 1
b3 1
b4 1
b6 1
b8 1
b9 1
b10 1

+ job10 job11 job12 job13 job14 job15

a1 1
a4 1
a7 1
b2 1
b5 1
b7 1


---- 103 VARIABLE z.L = 59.379total cost


When we add teams to the model, we see:
 

----    142 VARIABLE x.L  assignment

job1 job2 job3 job4 job5 job6 job7 job8 job9

a1 1
a5 1
a6 1
b3 1
b4 1
b9 1
b10 1
team17 1
team28 1

+ job10 job11 job12 job13 job14 job15

a4 1
a7 1
b2 1
b5 1
team86 1
team91 1


---- 142 VARIABLE z.L = 40.057total cost


The objective goes down. That makes sense: we can select some really cheap teams. To verify that we do not select a worker twice, I also generated a different solution report:
 

----    153 SET sol alternative solution report

job1 job2 job3 job4 job5 job6 job7 job8 job9

team17.a2 YES
team17.b7 YES
team28.a3 YES
team28.b8 YES
- .a1 YES
- .a5 YES
- .a6 YES
- .b3 YES
- .b4 YES
- .b9 YES
- .b10 YES

+ job10 job11 job12 job13 job14 job15

team86.a9 YES
team86.b6 YES
team91.a10 YES
team91.b1 YES
- .a4 YES
- .a7 YES
- .b2 YES
- .b5 YES


This confirms that workers are not duplicated in the solution.

Finally, some performance numbers. All these models are easy to solve, even the larger ones.


----    144 PARAMETER resultscompare statistics

assign sidecon final

type RMIP MIP MIP
vars 301.0001801.0001801.000
discr 300.0001800.0001800.000
equs 36.000156.00036.000
status Optimal Optimal Optimal
obj 59.37940.05740.057
time 0.1720.4220.515
nodes NA
iterations 12.00085.00085.000


For the MIP models, we see that the solver did not need to use any branching (zero nodes).

Conclusion


I am not sure this model can be used as-is for the purpose described in [1]. It is a good tool to think a bit about the problem, however. Furthermore, it is a good way to assess the quality of solutions when developing heuristics. MIP solvers have the special property that they can provide proven optimal solutions or a gap that gives some indication about the quality of the solution. 

References



Appendix: GAMS model


$ontext

 
A variant of an assignment problem.

 
References:
    
https://stackoverflow.com/questions/68482524/assignment-problem-with-2-workers-per-job
    
https://yetanothermathprogrammingconsultant.blogspot.com/2021/07/a-variant-of-assignment-problem.html


$offtext




*------------------------------------------------------------------
* basic data
*------------------------------------------------------------------

set
    i
'workers+teams'/a1*a10, b1*b10, team1*team100/
    w(i)
'workers'/a1*a10,b1*b10/
    a(w)
'type-A workers'/a1*a10/
    b(w)
'type-B workers'/b1*b10/
    t(i) 
'teams'/team1*team100/
    team(t,w)
'composition of teams'
    j
'jobs'/job1*job15/
;

display i,w,a,b,t,j;

*------------------------------------------------------------------
* enumerate possible teams
*------------------------------------------------------------------

set t1(t) /team1/;
loop((a,b),
   team(t1,a) =
yes;
   team(t1,b) =
yes;
* next element:
   t1(t) = t1(t-1);
);
option team:0:0:8;
display team;



*------------------------------------------------------------------
* random cost coefficients
*------------------------------------------------------------------

parameter c(i,j) 'cost coefficients';
c(i,j) = uniform(0,100);
display c;


*------------------------------------------------------------------
* reporting macros
*------------------------------------------------------------------

acronym TimeLimit, Optimal, Error;
acronym MIP,RMIP;

parameter results(*,*) 'compare statistics';
$macro report(m,label,modeltype)  \
    results(
'type',label) = modeltype; \
    results(
'vars',label) = m.numVar; \
    results(
'  discr',label) = m.numDVar; \
    results(
'equs',label) = m.numEqu; \
    results(
'status',label) = Error; \
    results(
'status',label)$(m.solvestat=1) = Optimal; \
    results(
'status',label)$(m.solvestat=3) = TimeLimit; \
    results(
'obj',label) = z.l; \
    results(
'time',label) = m.resusd; \
    results(
'nodes',label) = m.nodusd; \
    results(
'iterations',label) = m.iterusd; \
    results(
'gap%',label)$(m.solvestat=3) = 100*abs(m.objest - m.objval)/abs(m.objest);   \
   
display results;


*------------------------------------------------------------------
* assignment problem (don't use teams)
* model uses w instead of i
*------------------------------------------------------------------

binaryvariable x(i,j) 'assignment';
variable z 'total cost';

equations
   obj1         
'assignment objective'
   assign1a(w)  
'assignment constraint'
   assign1b(j)  
'assignment constraint'
;

obj1..        z =e=
sum((w,j),c(w,j)*x(w,j));
assign1a(w).. 
sum(j, x(w,j)) =l= 1;
assign1b(j).. 
sum(w ,x(w,j)) =e= 1;

model assign1 /all/;

* solve as RMIP: automatically integer
solve assign1 minimizing z using rmip;

option x:0;
display x.l,z.l;

report(assign1,
'assign',RMIP)

*------------------------------------------------------------------
* assignment problem with side constraint
* assignment constraints now use i
*------------------------------------------------------------------

equations
   obj2        
'assignment objective'
   assign2a(i)  
'assignment constraint'
   assign2b(j)  
'assignment constraint'
   side(w)     
'side-constraint'
;

obj2..         z =e=
sum((i,j),c(i,j)*x(i,j));
assign2a(i).. 
sum(j, x(i,j)) =l= 1;
assign2b(j).. 
sum(i ,x(i,j)) =e= 1;
side(w)..     
sum(j, x(w,j) + sum(team(t,w),x(t,j))) =l= 1;


option optcr=0,threads=8;

model assign2 /all-assign1/;
solve assign2 minimizing z using mip;

display x.l,z.l;

report(assign2,
'sidecon',MIP)


*------------------------------------------------------------------
* drop first assignment constraint
*------------------------------------------------------------------

model assign3 /assign2-assign2a/;
solve assign3 minimizing z using mip;

display x.l,z.l;

report(assign3,
'final',MIP)

*------------------------------------------------------------------
* solution report with team composition
*------------------------------------------------------------------

set sol(*,w,j) 'alternative solution report';
sol(team(t,w),j)$(x.l(t,j)>0.5) =
yes;
sol(
'-',w,j)$(x.l(w,j)>0.5) = yes;
display sol;


Viewing all articles
Browse latest Browse all 809

Trending Articles