I have a problem where I want to solve for the min number of points needed to
distribute along the edge of two rectangles:
The requirements are that opposing sides have the same number of points total.
Also, the edges in the middle which are common must have same number of points.
The edges in each rectangle may be broken into different number of segments,
as denoted by the + below
-------------- -------------
| | | |
| | | +
+. | | |
| | | +
| | | |
------------- --------------
I have attached a separate file that shows an input deck that does this (it is
a deck in the old MPS format, btw). The problem setup will work for this
case, but it is lacking an additional constraint that I want to impose...
namely that the final ratio of the number of points in each segment to the
total number on each edge should stay as close as possible to original ratio
(the min values input originally)
I can't seem to figure out how to impose this constraint ... just wondering if
anyone else can enlighten me?
Thanks!
Roger
NAME QUAD01
ROWS
*
* Opposing Edge Point Count Constraints
* There are 2 constraints for each surface
* SxE13 constrain points on edge 1,3 to be same
* SxE24 constrain points on edge 2,4 to be same
*
E R1 S1E13
E R2 S1E24
E R3 S2E13
E R4 S2E24
*
* Adjacency Edge Point Count Constraints
* There is one constraint for each segment that
* has more than one adjacent member in the CSC object
* SxAn is the constraint for the n-th segment of Surface x
* Numbers between colons are segment indices
E R5 S1A2:2:9
*
* Cost Function
*
N COST
COLUMNS
*
* Each column corresponds to each segment in the
* CSC data data structure, numbered sequentially
* in order
*
C1 R1 1.0
C1 COST 1.0
C2 R2 1.0
C2 R5 1.0
C2 COST 1.0
C3 R1 -1.0
C3 COST 1.0
C4 R2 -1.0
C4 COST 1.0
C5 R2 -1.0
C5 COST 1.0
C6 R2 -1.0
C6 COST 1.0
C7 R2 -1.0
C7 COST 1.0
C8 R2 -1.0
C8 COST 1.0
C9 R3 1.0
C9 R5 -1.0
C9 COST 1.0
C10 R4 1.0
C10 COST 1.0
C11 R3 -1.0
C11 COST 1.0
C12 R3 -1.0
C12 COST 1.0
C13 R4 -1.0
C13 COST 1.0
*(1) 1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
*(2) 0, 1, 0,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0,
*(3) 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,-1,-1, 0,
*(4) 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,-1,
*(5) 0, 1, 0, 0, 0, 0, 0, 0,-1, 0, 0, 0, 0,
RHS
*
* Surf 1 Edges2-4 = -4
* Surf 2 Edges1-3 = -1
RHS01 R2 -4
RHS01 R3 -1
BOUNDS
*
* These are lower bounds on the number of points
* as determined by the spacing properties from the
* CSC Segments
*
LO BOUND01 C1 48
LO BOUND01 C2 10
LO BOUND01 C3 48
LO BOUND01 C4 11
LO BOUND01 C5 5
LO BOUND01 C6 5
LO BOUND01 C7 5
LO BOUND01 C8 10
LO BOUND01 C9 10
LO BOUND01 C10 26
LO BOUND01 C11 3
LO BOUND01 C12 6
LO BOUND01 C13 26
ENDATA
_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk