vv

13837 Reputation

20 Badges

9 years, 319 days

MaplePrimes Activity


These are replies submitted by vv

@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.

@shzan 

Sorry but still not clear. You have a polynomial in several variables and you want a special order for its monomials. You must define this order. It does not matter whether this depends on the polynomial but it must be defined, I cannot guess it.

If this order cannot be expressed in terms of plex/grlex/tdeg accepted by sort then the list of the terms must be sorted via a custom function.

Maybe what you want is:

n:=9;  plex(seq([u[i],v[i]][], i=n..1,-1),d);
    plex(u[9], v[9], u[8], v[8], u[7], v[7], u[6], v[6], u[5], v[5],   u[4], v[4], u[3], v[3], u[2], v[2], u[1], v[1], d)

 

@acer 

Documented but still strange (at least in this case)    :-)

First 116 117 118 119 120 121 122 Last Page 118 of 176