Home

Simple Solver Problem - Can't get it to work

%3CLINGO-SUB%20id%3D%22lingo-sub-773691%22%20slang%3D%22en-US%22%3ESimple%20Solver%20Problem%20-%20Can't%20get%20it%20to%20work%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-773691%22%20slang%3D%22en-US%22%3E%3CP%3EHello%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20simple%20solver%20problem%20that%20I%20can't%20seem%20to%20get%20to%20work%20and%20I'm%20not%20sure%20why.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20a%20simple%20distribution%20of%20resources%20problem%2C%20and%20what%20I'm%20trying%20to%20solve%20for%20is%20the%20smallest%20number%20of%20exchanges%20required%20to%20meet%20the%20constraints.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20a%20photo%20of%20the%20excel%20sheet%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20651px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124496i71A842559D1B9D81%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-25_10-46-44.png%22%20title%3D%222019-07-25_10-46-44.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20in%20the%20above%20example%2C%20Brad%20is%20short%20996%20units%2C%20Matt%20is%20owed%20294%20units%2C%20etc.%26nbsp%3B%20The%20red%20cells%20are%20the%20variable%20cells.%26nbsp%3B%20The%20blue%20cells%20sum%20the%20totals%20next%20to%20each%20person%20and%20the%20corresponding%20red%20cells.%26nbsp%3B%20The%20net%20should%20equal%200.%26nbsp%3B%20So%20the%20blue%20cells%20are%20constraints%20that%20must%20%3D%200.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%2C%20the%20objective%20is%20the%20count%20cell.%26nbsp%3B%20I%20want%20this%20to%20be%20the%20minimum%20number%20of%20%22exchanges%22%20that%20need%20to%20occur.%26nbsp%3B%20I.e.%20Brad%20gives%20Matt%20294%20(now%20Matt's%20balance%20%3D%200)%2C%20Brad%20gives%20John%20143%20(now%20Matt's%20balance%20%3D%200)%2C%20and%20that's%202%20exchanges.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20a%20screenshot%20of%20the%20solver%20parameter%20setup%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20570px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124501iE0E4C945EFD7B424%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-25_11-01-07.png%22%20title%3D%222019-07-25_11-01-07.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20a%20solution%20that%20I%20came%20up%20on%20my%20own...just%20plugging%20in%20numbers%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20602px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124498i85D014EE921F2C5E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-25_10-56-35.png%22%20title%3D%222019-07-25_10-56-35.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESee%20how%20the%20count%20%3D%209%2C%20the%20total%20number%20of%20exchanges.%26nbsp%3B%20However%2C%20when%20I%20run%20the%20solver%20solution%2C%20no%20matter%20if%20I%20use%20GRG%20Non%20Linear%20or%20Evolutionary%2C%20I%20get%20something%20like%20this...which%20is%20certainly%20not%20the%20minimum%20since%20I%20was%20able%20to%20find%20a%20solution%20for%209%20exchanges%20just%20guessing...(10%20is%20greater%20than%209)%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20604px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F124503i9C5EFCB5149A5037%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%222019-07-25_11-02-51.png%22%20title%3D%222019-07-25_11-02-51.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20am%20I%20missing%3F%26nbsp%3B%20This%20seems%20pretty%20simple%20for%20solver%2C%20but%20I%20can't%20get%20it%20to%20work.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20help!%26nbsp%3B%20Thank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-773691%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Eequation%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESolver%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
dwhit7
Visitor

Hello

 

I have a simple solver problem that I can't seem to get to work and I'm not sure why.

 

It is a simple distribution of resources problem, and what I'm trying to solve for is the smallest number of exchanges required to meet the constraints.

 

Here's a photo of the excel sheet:

2019-07-25_10-46-44.png

 

So in the above example, Brad is short 996 units, Matt is owed 294 units, etc.  The red cells are the variable cells.  The blue cells sum the totals next to each person and the corresponding red cells.  The net should equal 0.  So the blue cells are constraints that must = 0.

 

Finally, the objective is the count cell.  I want this to be the minimum number of "exchanges" that need to occur.  I.e. Brad gives Matt 294 (now Matt's balance = 0), Brad gives John 143 (now Matt's balance = 0), and that's 2 exchanges.

 

Here is a screenshot of the solver parameter setup:

2019-07-25_11-01-07.png

 

Here is a solution that I came up on my own...just plugging in numbers:

2019-07-25_10-56-35.png

 

See how the count = 9, the total number of exchanges.  However, when I run the solver solution, no matter if I use GRG Non Linear or Evolutionary, I get something like this...which is certainly not the minimum since I was able to find a solution for 9 exchanges just guessing...(10 is greater than 9):

2019-07-25_11-02-51.png

 

What am I missing?  This seems pretty simple for solver, but I can't get it to work.

 

Please help!  Thank you,

Related Conversations
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies