LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (August 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 18 Aug 2006 11:44:31 -0400
Reply-To:     "Luo, Peter" <pluo@DRAFTNET.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Luo, Peter" <pluo@DRAFTNET.COM>
Subject:      A 'weight' statement in proc lp
Content-Type: text/plain; charset="US-ASCII"

The following is a hypothetical example which mimics what I was trying to accomplish: I have 7 customers and 3 products, and I would like to find an optimal solution to assign the products to the customers.

Objective: to maximize total profit

Constraints: productA=2, productB=2, productC=1;

each customer can only be assigned to one product, i.e. x11+x12+x13<=1;..x71+x72+x73<=1

The following codes works well. Now instead of individual customer, I have 7 customer GROUPS and group size varies. I can modify the 'object' line to incorporate the group size difference, but don't know exactly how to modify the other rows. The objective and constraints should remain the same, i.e. each customer group can only be assigned to one product.

Thanks

Data dense;

infile datalines missover;

input _row_ $6. x11 x12 x13 x21 x22 x23 x31 x32 x33 x41 x42 x43 x51 x52 x53 x61 x62

x63 x71 x72 x73 _type_ $ _rhs_;

datalines;

object 7 9 3 7 5 6 7 5 5 7 3 6 6 7 8 5 8 7 5 1 0 max .

cust1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 le 1

cust2 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 le 1

cust3 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 le 1

cust4 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 le 1

cust5 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 le 1

cust6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 le 1

cust7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 le 1

prodA 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 eq 2

prodB 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 eq 2

prodC 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 eq 1

binary 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 binary .

;

run;

proc lp; run; quit;


Back to: Top of message | Previous page | Main SAS-L page