## 130 Reputation

11 years, 325 days

## Thank you!...

Many thanks, Georgios ... much appreciated!

## Great!...

Thank you for clearing this up .... I appreciate your help.

## Thanks!...

That's great! I appreciate it ...

## Thanks .... but still no luck!...

Thanks for this.

However, I initially used that command and am still receiving an error message. As follows ...

Error, invalid input: rand expects its first argument, r,  to be of the type {posint, integer..integer} but received -.5 .. .5

## As expected....

Thanks .... I guessed so.

## That's clever!...

Thanks for that .... it works fine!

## Thanks!...

That works fine .... thank you!

## Agreed...

That matches my result ... thanks, Thomas.

The equation structure is rather mis-leading (at least to me), so you've clarified my thinking here.

I appreciate it.

## Not quite!...

I appreciate the response, Thomas. Thanks.

However, that routine returns L := [d[0]*x[i, 0, 1]+d[0]*x[i, 1, 1]+d[1]*x[i, 0, 1]+d[1]*x[i, 1, 1], d[0]*x[i, 0, 2]+d[0]*x[i, 1, 2]+d[1]*x[i, 0, 2]+d[1]*x[i, 1, 2]].

As you can see, the values, i=0 and i=1 are not carried through to the full series; we only receive unknown terms, for instance x[i, 1,2] and so on. This is what I am trying to protect against. As the equation is stated, one would think that your routine would work ... but you see the problem. If we then take the values i=0 and i=1, then we will obtain two sequences ... however, I need to be sure.

Any other suggestions?

## Model Detail...

Constraint Problem

Given the sets:

 • C = {1,2, ..., n}
 • K = {1,2, ...., m}
 • Arcs, A ={i,j},  representing connections between locations, i and j. For each arc, (i,j), i≠j, i≠n+1 and j≠0.

For each arc, {i,j}, i≠j, there are two matrices namely   and  and for each point, i, there is a specified positive quantity,

Further, we impose a positive integer value on

There are two decision variables under consideration; one of which is binary.

 •
 •

subject to the constraints

(vi)

(vii)

(viii)

 >

The following model values are set-up for simplicity.

 >

The values for

 >
 >

 >

The vector, :

 >

The quantitity q:

 >

The objective function:

 >

Constraint (1)

 >

 >

 >

 >

 >

 >
 >

Constraint (7)

 >
 >

For

Constraint (8): Setting the condition i ≠ j

OPEN

Constraint (9): Setting the condition i≠ n+1

OPEN

Constraint (10): Setting the condition  j ≠ 0

OPEN

Constraint (11)

The final constraint require binary outputs, zero or one.

Excluding constraints (8) to (10), the consolidated constraints are:

 >

The list, L, of all terms is given by the sequence:

 >

The set of elements binary variables. The binaryvariables option may be given by the indets syntax.

The solution is:

 >
 (1)

 >
 (2)
 >

Many thanks for the effort and response - I appreciate it.

As you recommended, I have included the worksheet. The constraints are incomplete (missing the final three). If you could review the structure, I'd be interested in your comments / feedback.

Thanks again!

Thanks so much!

## Great idea (and attitude)!...

 >

This is a combinatorial (multi-objective) optimization problem in which the minimization of the following is sought:

(a) No of vehicles

(b) Total travel time

(c) Waiting time

(d) Total distance incurred by the fleet

This is an extension of the classic vehicle routing problem. It accounts for the following features.

Let

V = Fleet of (homogeneous) vehicles

C = Customers (1,2,..., n)

= Cost

= Time (includes service time at customer j)

q = vehicle capacity

Each customer has a time window,

Assume the service time is in direct proportion to the demand at the location

Unused vehicle is modeled by driving the empty route, (0, n+1)

k 2 V

i 2 N

j 2 N

There are two decision variables, namely:

1.

2.

The objective to be minimized is:

 >
 (1)

subject to the following 8 constraints

Each customer is visited once only:

 >
 (2)

The vehicle load limits are defined

 >
 (3)

Each vehicle leaves depot 0

 >
 (4)

After arriving at a customer, the vehicle departs

 >
 (5)

Finally, the vehicle arrives at the depot, n+1

 >
 (6)

Vehicle k cannot arrive at j before

 >
 (7)

The time windows must be observed (assume

 >
 (8)

Integrality constraint

 >
 (9)
 >
 >

## Consolidated matrix form...

The use of matrices is really useful here.

Many thanks!

## it works now...

That's great!

Thanks for your interest and help.

## Reconsidered constraints...

Thanks for your timely response .... much appreciated.