DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
423 stars 157 forks source link

Bug with GLPK and restrict_positions_for_opposing_team #206

Open anthonyshook opened 4 years ago

anthonyshook commented 4 years ago

There is seemingly a bug with the restrict_positions_for_opposing_team method when using GLPK as a solver.

The following code works fine with the default CBC solver.

import pydfs_lineup_optimizer as pd

opt = pd.get_optimizer(pd.Site.DRAFTKINGS, pd.Sport.FOOTBALL)
opt.load_players_from_csv('./DKSalaries.csv')
opt.restrict_positions_for_opposing_team(['QB'], ['DST'])
for l in opt.optimize(10):
  print(l)

But when I change the solver to GLPK_CMD from the PuLP package, and try to run the same code, I get the error:

GLPSOL: GLPK LP/MIP Solver, v4.65
Parameter(s) specified in the command line:
 --cpxlp C:\~\~\~\Local\Temp\3b2cafb7e9ec4478b6eec6566acff0a7-pulp.lp
 -o C:\~\~\~\Local\Temp\3b2cafb7e9ec4478b6eec6566acff0a7-pulp.sol
Reading problem data from 'C:\~\~\~\Local\Temp\3b2cafb7e9ec4478b6eec6566acff0a7-pulp.lp'...
C:\~\~\AppData\Local\Temp\3b2cafb7e9ec4478b6eec6566acff0a7-pulp.lp:259: symbol '1375' in wrong position
CPLEX LP file processing error

(note, ~ have been used to replace the path to my local user temp folder)

Any thoughts on why? Or do we think this is just an GLPK problem that can't be solved on the PYDFS end?

sansbacon commented 4 years ago

Can you post the contents of the solution file?

anthonyshook commented 4 years ago

Sure, here it is -- the offending element is on line 259 in this file. The actual error is: symbol '2262' in wrong position

I've included the entire code block below, but here's just the particular lines, numbers included:

258 > Binaries
259 > 2262d107_4805_4c65_80cc_01d01b984de4
260 > 355f4232_a9ab_43a2_bea5_ee603f8df601
261 > 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5
262 > 6635d8a5_3d87_4fa8_94bf_1e610e522c2c
Click to expand the entire code block ``` \* Daily_Fantasy_Sports *\ Maximize OBJ: 27.5 Player_0 + 20.44 Player_1 + 27.3 Player_10 + 11 Player_108 + 14.5 Player_11 + 18.1 Player_12 + 19.9 Player_13 + 11.1 Player_14 + 2.9 Player_15 + 9.02 Player_16 + 7.7 Player_17 + 12.82 Player_18 + 32.1 Player_2 + 14.2 Player_20 + 4 Player_23 + 21.5 Player_24 + 12.3 Player_25 + 8 Player_26 + 12 Player_27 + 22.8 Player_3 + 13.5 Player_30 + 7.4 Player_31 + 14.9 Player_32 + 4.3 Player_33 + 6.4 Player_34 + Player_35 + 0.26 Player_36 + 16.4 Player_37 + 10.9 Player_38 + 0.9 Player_39 + 15.6 Player_4 + 6.7 Player_41 + 0.3 Player_42 + 0.4 Player_47 + 5 Player_48 + 17 Player_5 + 0.2 Player_50 + 1.4 Player_52 + 1.7 Player_53 + 0.8 Player_57 + 1.6 Player_59 + 9.7 Player_6 + 13.7 Player_61 + 15 Player_63 + 5 Player_64 + 4.1 Player_65 + 7 Player_66 + 4.1 Player_67 + 11.9 Player_69 + 21.82 Player_7 + 2.2 Player_71 + 3.9 Player_72 + 15 Player_74 + 2.3 Player_75 + 22.2 Player_8 + 6 Player_81 + 2.6 Player_83 + 1.8 Player_88 + 22.8 Player_9 + 2 Player_99 Subject To _C1: 8000 Player_0 + 7500 Player_1 + 5900 Player_10 + 2500 Player_100 + 2500 Player_101 + 2500 Player_102 + 2500 Player_103 + 2500 Player_104 + 2500 Player_105 + 2500 Player_106 + 2200 Player_107 + 2000 Player_108 + 5900 Player_11 + 5900 Player_12 + 5800 Player_13 + 5600 Player_14 + 5400 Player_15 + 5300 Player_16 + 5200 Player_17 + 5100 Player_18 + 5100 Player_19 + 7400 Player_2 + 5100 Player_20 + 4900 Player_21 + 4900 Player_22 + 4900 Player_23 + 4800 Player_24 + 4800 Player_25 + 4700 Player_26 + 4700 Player_27 + 4700 Player_28 + 4600 Player_29 + 7400 Player_3 + 4600 Player_30 + 4600 Player_31 + 4400 Player_32 + 4400 Player_33 + 4300 Player_34 + 4300 Player_35 + 4300 Player_36 + 4300 Player_37 + 4200 Player_38 + 4100 Player_39 + 7200 Player_4 + 4100 Player_40 + 4100 Player_41 + 4000 Player_42 + 4000 Player_43 + 4000 Player_44 + 4000 Player_45 + 4000 Player_46 + 4000 Player_47 + 4000 Player_48 + 4000 Player_49 + 6700 Player_5 + 4000 Player_50 + 4000 Player_51 + 4000 Player_52 + 4000 Player_53 + 4000 Player_54 + 4000 Player_55 + 4000 Player_56 + 4000 Player_57 + 4000 Player_58 + 3800 Player_59 + 6500 Player_6 + 3700 Player_60 + 3600 Player_61 + 3600 Player_62 + 3600 Player_63 + 3500 Player_64 + 3400 Player_65 + 3400 Player_66 + 3300 Player_67 + 3300 Player_68 + 3300 Player_69 + 6200 Player_7 + 3200 Player_70 + 3200 Player_71 + 3200 Player_72 + 3100 Player_73 + 3100 Player_74 + 3100 Player_75 + 3000 Player_76 + 3000 Player_77 + 3000 Player_78 + 3000 Player_79 + 6000 Player_8 + 3000 Player_80 + 3000 Player_81 + 3000 Player_82 + 3000 Player_83 + 3000 Player_84 + 3000 Player_85 + 3000 Player_86 + 3000 Player_87 + 3000 Player_88 + 3000 Player_89 + 6000 Player_9 + 3000 Player_90 + 3000 Player_91 + 3000 Player_92 + 3000 Player_93 + 2800 Player_94 + 2800 Player_95 + 2700 Player_96 + 2500 Player_97 + 2500 Player_98 + 2500 Player_99 <= 50000 _C10: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_42 <= 1000 _C100: 1000 Player_41 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C101: 1000 Player_51 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C102: 1000 Player_53 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C103: 1000 Player_55 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C104: 1000 Player_57 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C105: 1000 Player_71 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C106: 1000 Player_75 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C107: 1000 Player_87 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C108: 1000 Player_89 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C109: 1000 Player_91 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C11: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_43 <= 1000 _C110: 1000 Player_93 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C111: Player_0 + Player_105 + Player_106 + Player_107 + Player_12 + Player_13 + Player_15 + Player_20 + Player_23 + Player_28 + Player_33 + Player_36 + Player_37 + Player_41 + Player_51 + Player_52 + Player_53 + Player_54 + Player_55 + Player_56 + Player_57 + Player_58 + Player_63 + Player_68 + Player_69 + Player_7 + Player_71 + Player_72 + Player_75 + Player_8 + Player_87 + Player_88 + Player_89 + Player_9 + Player_90 + Player_91 + Player_92 + Player_93 - 9 total_game_HOU_BAL <= 0 _C112: Player_0 + Player_105 + Player_106 + Player_107 + Player_12 + Player_13 + Player_15 + Player_20 + Player_23 + Player_28 + Player_33 + Player_36 + Player_37 + Player_41 + Player_51 + Player_52 + Player_53 + Player_54 + Player_55 + Player_56 + Player_57 + Player_58 + Player_63 + Player_68 + Player_69 + Player_7 + Player_71 + Player_72 + Player_75 + Player_8 + Player_87 + Player_88 + Player_89 + Player_9 + Player_90 + Player_91 + Player_92 + Player_93 - total_game_HOU_BAL >= 0 _C113: Player_1 + Player_100 + Player_101 + Player_102 + Player_103 + Player_104 + Player_108 + Player_16 + Player_17 + Player_19 + Player_24 + Player_25 + Player_27 + Player_3 + Player_38 + Player_4 + Player_40 + Player_46 + Player_47 + Player_48 + Player_49 + Player_5 + Player_50 + Player_59 + Player_6 + Player_62 + Player_64 + Player_66 + Player_82 + Player_83 + Player_84 + Player_85 + Player_86 + Player_96 + Player_99 - 9 total_game_LAC_KC <= 0 _C114: Player_1 + Player_100 + Player_101 + Player_102 + Player_103 + Player_104 + Player_108 + Player_16 + Player_17 + Player_19 + Player_24 + Player_25 + Player_27 + Player_3 + Player_38 + Player_4 + Player_40 + Player_46 + Player_47 + Player_48 + Player_49 + Player_5 + Player_50 + Player_59 + Player_6 + Player_62 + Player_64 + Player_66 + Player_82 + Player_83 + Player_84 + Player_85 + Player_86 + Player_96 + Player_99 - total_game_LAC_KC >= 0 _C115: Player_10 + Player_11 + Player_14 + Player_18 + Player_2 + Player_21 + Player_22 + Player_26 + Player_29 + Player_30 + Player_31 + Player_32 + Player_34 + Player_35 + Player_39 + Player_42 + Player_43 + Player_44 + Player_45 + Player_60 + Player_61 + Player_65 + Player_67 + Player_70 + Player_73 + Player_74 + Player_76 + Player_77 + Player_78 + Player_79 + Player_80 + Player_81 + Player_94 + Player_95 + Player_97 + Player_98 - 9 total_game_ARI_WAS <= 0 _C116: Player_10 + Player_11 + Player_14 + Player_18 + Player_2 + Player_21 + Player_22 + Player_26 + Player_29 + Player_30 + Player_31 + Player_32 + Player_34 + Player_35 + Player_39 + Player_42 + Player_43 + Player_44 + Player_45 + Player_60 + Player_61 + Player_65 + Player_67 + Player_70 + Player_73 + Player_74 + Player_76 + Player_77 + Player_78 + Player_79 + Player_80 + Player_81 + Player_94 + Player_95 + Player_97 + Player_98 - total_game_ARI_WAS >= 0 _C117: total_game_ARI_WAS + total_game_HOU_BAL + total_game_LAC_KC >= 2 _C118: Player_0 + Player_1 + Player_10 + Player_100 + Player_101 + Player_102 + Player_103 + Player_104 + Player_105 + Player_106 + Player_107 + Player_108 + Player_11 + Player_12 + Player_13 + Player_14 + Player_15 + Player_16 + Player_17 + Player_18 + Player_19 + Player_2 + Player_20 + Player_21 + Player_22 + Player_23 + Player_24 + Player_25 + Player_26 + Player_27 + Player_28 + Player_29 + Player_3 + Player_30 + Player_31 + Player_32 + Player_33 + Player_34 + Player_35 + Player_36 + Player_37 + Player_38 + Player_39 + Player_4 + Player_40 + Player_41 + Player_42 + Player_43 + Player_44 + Player_45 + Player_46 + Player_47 + Player_48 + Player_49 + Player_5 + Player_50 + Player_51 + Player_52 + Player_53 + Player_54 + Player_55 + Player_56 + Player_57 + Player_58 + Player_59 + Player_6 + Player_60 + Player_61 + Player_62 + Player_63 + Player_64 + Player_65 + Player_66 + Player_67 + Player_68 + Player_69 + Player_7 + Player_70 + Player_71 + Player_72 + Player_73 + Player_74 + Player_75 + Player_76 + Player_77 + Player_78 + Player_79 + Player_8 + Player_80 + Player_81 + Player_82 + Player_83 + Player_84 + Player_85 + Player_86 + Player_87 + Player_88 + Player_89 + Player_9 + Player_90 + Player_91 + Player_92 + Player_93 + Player_94 + Player_95 + Player_96 + Player_97 + Player_98 + Player_99 = 9 _dummy: __dummy = 0 _C119: __dummy = 0 _C12: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_45 <= 1000 _C120: Player_0 + Player_1 + Player_10 + Player_16 + Player_18 + Player_19 + Player_21 + Player_22 + Player_28 + Player_29 + Player_36 + Player_40 + Player_42 + Player_46 + Player_51 + Player_7 >= 1 _C121: Player_11 + Player_13 + Player_15 + Player_20 + Player_27 + Player_3 + Player_30 + Player_32 + Player_34 + Player_39 + Player_43 + Player_44 + Player_45 + Player_47 + Player_48 + Player_49 + Player_50 + Player_52 + Player_53 + Player_54 + Player_55 + Player_56 + Player_57 + Player_58 + Player_6 >= 2 _C122: Player_12 + Player_14 + Player_17 + Player_2 + Player_23 + Player_24 + Player_26 + Player_31 + Player_33 + Player_35 + Player_37 + Player_38 + Player_4 + Player_41 + Player_59 + Player_60 + Player_62 + Player_64 + Player_65 + Player_68 + Player_71 + Player_73 + Player_76 + Player_77 + Player_78 + Player_79 + Player_8 + Player_80 + Player_82 + Player_83 + Player_84 + Player_85 + Player_86 + Player_87 + Player_88 + Player_89 + Player_90 + Player_91 + Player_92 + Player_93 >= 3 _C123: Player_100 + Player_101 + Player_102 + Player_103 + Player_104 + Player_105 + Player_106 + Player_25 + Player_5 + Player_61 + Player_67 + Player_69 + Player_70 + Player_72 + Player_75 + Player_9 + Player_94 + Player_95 + Player_96 + Player_97 + Player_98 + Player_99 >= 1 _C124: Player_100 + Player_101 + Player_102 + Player_103 + Player_104 + Player_105 + Player_106 + Player_11 + Player_12 + Player_13 + Player_14 + Player_15 + Player_17 + Player_2 + Player_20 + Player_23 + Player_24 + Player_25 + Player_26 + Player_27 + Player_3 + Player_30 + Player_31 + Player_32 + Player_33 + Player_34 + Player_35 + Player_37 + Player_38 + Player_39 + Player_4 + Player_41 + Player_43 + Player_44 + Player_45 + Player_47 + Player_48 + Player_49 + Player_5 + Player_50 + Player_52 + Player_53 + Player_54 + Player_55 + Player_56 + Player_57 + Player_58 + Player_59 + Player_6 + Player_60 + Player_61 + Player_62 + Player_64 + Player_65 + Player_67 + Player_68 + Player_69 + Player_70 + Player_71 + Player_72 + Player_73 + Player_75 + Player_76 + Player_77 + Player_78 + Player_79 + Player_8 + Player_80 + Player_82 + Player_83 + Player_84 + Player_85 + Player_86 + Player_87 + Player_88 + Player_89 + Player_9 + Player_90 + Player_91 + Player_92 + Player_93 + Player_94 + Player_95 + Player_96 + Player_97 + Player_98 + Player_99 >= 7 _C125: Player_107 + Player_108 + Player_63 + Player_66 + Player_74 + Player_81 >= 1 _C13: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_60 <= 1000 _C14: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_67 <= 1000 _C15: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_77 <= 1000 _C16: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_94 <= 1000 _C17: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_95 <= 1000 _C18: - 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + Player_81 = 0 _C19: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_14 <= 1000 _C2: - 2262d107_4805_4c65_80cc_01d01b984de4 + Player_74 = 0 _C20: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_18 <= 1000 _C21: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_21 <= 1000 _C22: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_26 <= 1000 _C23: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_29 <= 1000 _C24: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_32 <= 1000 _C25: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_34 <= 1000 _C26: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_39 <= 1000 _C27: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_44 <= 1000 _C28: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_61 <= 1000 _C29: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_65 <= 1000 _C3: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_2 <= 1000 _C30: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_70 <= 1000 _C31: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_73 <= 1000 _C32: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_76 <= 1000 _C33: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_78 <= 1000 _C34: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_79 <= 1000 _C35: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_80 <= 1000 _C36: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_97 <= 1000 _C37: 6635d8a5_3d87_4fa8_94bf_1e610e522c2c + 1000 Player_98 <= 1000 _C38: - 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + Player_66 = 0 _C39: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_6 <= 1000 _C4: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_10 <= 1000 _C40: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_16 <= 1000 _C41: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_17 <= 1000 _C42: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_19 <= 1000 _C43: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_25 <= 1000 _C44: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_27 <= 1000 _C45: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_38 <= 1000 _C46: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_46 <= 1000 _C47: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_47 <= 1000 _C48: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_62 <= 1000 _C49: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_82 <= 1000 _C5: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_11 <= 1000 _C50: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_83 <= 1000 _C51: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_84 <= 1000 _C52: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_99 <= 1000 _C53: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_101 <= 1000 _C54: 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 + 1000 Player_102 <= 1000 _C55: - 355f4232_a9ab_43a2_bea5_ee603f8df601 + Player_108 = 0 _C56: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_1 <= 1000 _C57: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_3 <= 1000 _C58: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_4 <= 1000 _C59: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_5 <= 1000 _C6: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_22 <= 1000 _C60: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_24 <= 1000 _C61: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_40 <= 1000 _C62: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_48 <= 1000 _C63: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_49 <= 1000 _C64: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_50 <= 1000 _C65: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_59 <= 1000 _C66: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_64 <= 1000 _C67: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_85 <= 1000 _C68: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_86 <= 1000 _C69: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_96 <= 1000 _C7: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_30 <= 1000 _C70: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_100 <= 1000 _C71: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_103 <= 1000 _C72: 355f4232_a9ab_43a2_bea5_ee603f8df601 + 1000 Player_104 <= 1000 _C73: Player_63 - a19eab41_076b_4156_9345_094d9e857bf0 = 0 _C74: 1000 Player_7 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C75: 1000 Player_8 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C76: 1000 Player_13 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C77: 1000 Player_23 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C78: 1000 Player_28 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C79: 1000 Player_33 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C8: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_31 <= 1000 _C80: 1000 Player_52 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C81: 1000 Player_54 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C82: 1000 Player_56 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C83: 1000 Player_58 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C84: 1000 Player_68 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C85: 1000 Player_69 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C86: 1000 Player_72 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C87: 1000 Player_88 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C88: 1000 Player_90 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C89: 1000 Player_92 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C9: 2262d107_4805_4c65_80cc_01d01b984de4 + 1000 Player_35 <= 1000 _C90: 1000 Player_105 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C91: 1000 Player_106 + a19eab41_076b_4156_9345_094d9e857bf0 <= 1000 _C92: Player_107 - e3224827_e59d_4652_be8e_b0eb00c7bc8d = 0 _C93: 1000 Player_0 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C94: 1000 Player_9 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C95: 1000 Player_12 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C96: 1000 Player_15 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C97: 1000 Player_20 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C98: 1000 Player_36 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 _C99: 1000 Player_37 + e3224827_e59d_4652_be8e_b0eb00c7bc8d <= 1000 Bounds __dummy = 0 Binaries 2262d107_4805_4c65_80cc_01d01b984de4 355f4232_a9ab_43a2_bea5_ee603f8df601 3dd3dd32_1be4_4e6a_b2a2_5bb75968b6d5 6635d8a5_3d87_4fa8_94bf_1e610e522c2c Player_0 Player_1 Player_10 Player_100 Player_101 Player_102 Player_103 Player_104 Player_105 Player_106 Player_107 Player_108 Player_11 Player_12 Player_13 Player_14 Player_15 Player_16 Player_17 Player_18 Player_19 Player_2 Player_20 Player_21 Player_22 Player_23 Player_24 Player_25 Player_26 Player_27 Player_28 Player_29 Player_3 Player_30 Player_31 Player_32 Player_33 Player_34 Player_35 Player_36 Player_37 Player_38 Player_39 Player_4 Player_40 Player_41 Player_42 Player_43 Player_44 Player_45 Player_46 Player_47 Player_48 Player_49 Player_5 Player_50 Player_51 Player_52 Player_53 Player_54 Player_55 Player_56 Player_57 Player_58 Player_59 Player_6 Player_60 Player_61 Player_62 Player_63 Player_64 Player_65 Player_66 Player_67 Player_68 Player_69 Player_7 Player_70 Player_71 Player_72 Player_73 Player_74 Player_75 Player_76 Player_77 Player_78 Player_79 Player_8 Player_80 Player_81 Player_82 Player_83 Player_84 Player_85 Player_86 Player_87 Player_88 Player_89 Player_9 Player_90 Player_91 Player_92 Player_93 Player_94 Player_95 Player_96 Player_97 Player_98 Player_99 a19eab41_076b_4156_9345_094d9e857bf0 e3224827_e59d_4652_be8e_b0eb00c7bc8d total_game_ARI_WAS total_game_HOU_BAL total_game_LAC_KC End ```
sansbacon commented 4 years ago

So it looks like the error comes from having the binary variable begin with a number. I recreated the example and saved the .lp file. I then changed the first binary variable to 'aaa' and the error was thrown on the next line of the solver file. You can test this out by editing the .lp file for your specific variables (the GLPK_CMD has a parameter for keepFiles=True which will save the .lp file to your working directory.

The solution for the library could be as simple as including a prefix 'b_' to the UUID with the changes below, although I must confess I don't know much about uuid4 or why it was chosen to create the variable name, but I think this should work:

aggregated_var = solver.add_variable(str(uuid4()), min_value=0, max_value=len(second_team_variables))

to

aggregated_var = solver.add_variable(f'b_{uuid4()}', min_value=0, max_value=len(second_team_variables))

As an aside, are you using GLPK_CMD for performance reasons? I'd start by filtering the player pool with players that project for at least X fantasy points, which will speed up the default solver.

anthonyshook commented 4 years ago

Hey, thanks for digging into this! I figured it would end up something like that -- never trust a number to do a letter's job.

And yes, it was for performance reasons, but I actually just switched over to using CPLEX_PY as my solver, and that has been successful so far. I've got a fork here where I can test the change to the aggregated_var call, when I've got the time, but unless @DimaKudosh (or you!) wants to tie this to a PR, I think it could be closed.