vv

14117 Reputation

20 Badges

10 years, 172 days

MaplePrimes Activity


These are replies submitted by vv

@Rouben Rostamian  

rij hat  is a versor (= rij/rij) , so the bold formula is OK

@Joe Riel 

Unfortunately Iterator will be anyway limited by the huge dimension of the discrete structure.
It will be not possible to use Permute for n=15 because 15! > 10^12;  20! > 10^18.
We will have to wait for the quantum computers.

@Joe Riel 

Thank you for the answer.
It is also strange for me that the procedure is also very slow for the very simple graph defined by

A:=Matrix(n, (i,j)->`if`(i=j,0,i+j)):
(
and here the triangle inequality holds)

but becomes very fast for e.g.

A:=Matrix(n, (i,j) -> evalf(abs(sin(i)-sin(j))));
(at least for n=10).

 

Very nice, vote up.
As optimizations I'd suggest:

1. Remove  HC(S):= P[k]  and recompute it at the end of MinPart (being a waste of memory).
2. Probably  combinat:-permute  should be called separately (at start) only r times for MinPart([m1,...,mr])
and then only translate the indices.

@Carl Love 

 

@Carl Love 

Yes, I know and I wanted to mention this. The problem is that for each set of each partition we must find  a minimal Hamiltonian path so, probably the running time will be prohibitive (even if parallel computations are used).

(But many sets will be eliminated because of the capacity constraint, so after all the attempt could be succesful).

@Carl Love 

An execution group may have several prompts (why?). For example, if a .mpl file is opened (via File > Open) all its contents is placed into a single execution group and each line has a prompt. The only way I know to delete the prompts is to copy & paste into Notepad (to remove the format information) and then paste back. Do you know another method? Thank you.

@Markiyan Hirnyk 

Simply solving the first 3 inequalities wrt y3 and using
y3 >= a, y3 >= b, y3 >= c  <==>  y3 >= max(a,b,c).

@Markiyan Hirnyk 

But compare with a "by hand" solution:

sol:={ y1 <= 0, y2 >= 0, y3 >= max( -(4/3)*y1-(2/3)*y2-5/3, -(3/2)*y1-(5/2)*y2-1, -y1-2*y2-1 ) };

 

@Carl Love 

Yes, but not "much more willing"; e.g.  for qgamma(0.8, 0.999);  # should be 1.164159836

 

@Joe Riel 

E.g.
R := rtable(antisymmetric,1..3, 1..3, (i,j)->i-j);

 

 

@Kitonum 

I agree, but I think that the command should have been programmed more carefully.

@Kitonum 
This one is bounded.

plots:-contourplot(1/(x^2+y^2), x = 0.05 .. 2, y = 0 .. 2, contours = 5);

(but here adding grid=[500,500]  ==> OK)

@brian bovril 

LPSolve will not be able to solve a VRP problem for n>20 say (I have tested on an abandoned "almost working" version). On the other side, the brute force (see the code in the other "VRP" thread)  works well for toy problems like this.

 

@brian bovril 

The code you have cited was from
http://www.mapleprimes.com/questions/220639-TSP-Integer-Program-Problem
and is for the TSP problem. (Note that in wiki the algorithm and the node 0 error is now corrected).
You try to use part of the code for VRP. It does not work.

What is needed is a correct and complete algorithm for VRP; it does not matter whether it uses a node 0 or not, the Maple code can be easily written and adapted.  Unfortunalely the algorithm is not clear (at least for me); for example what is the difference between N and C; do they contain 0? You should try to find a more clear version, or maybe someone here already knows these things.

 

@Joe Riel 

So, if A is a nxn binary matrix and d :=  its usual determinant, then:
- A has the rank n over the field Q (or R or C) iff d <> 0.
- A has the rank n over the field GF(2)   ( = Z2 )   iff d is odd.

First 117 118 119 120 121 122 123 Last Page 119 of 177