Carl Love

## 26513 Reputation

11 years, 186 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

## MaplePrimes Activity

### These are replies submitted by Carl Love

[Edit: I understand dharr's followup explanation, and I withdraw my comment about the work being incorrect. I didn't realize that it was just solving (correctly) a different problem than the OP intended, specifically one where certain edges are forbidden.]

@dharr Your algorithm for reducing the Hamiltonian cycle to a Hamiltonian path is incorrect. In particular, I don't understand how you chose your edges. If I apply my dummy-vertex algorithm (from my Answer below) to your points, I get a significantly shorter minimal path, 7.3 vs. 9.8. You can easily verify from the plots that my path is Hamiltonian and my edge weights are the same as yours.

restart:
pts:= [[0,0], [1,2], [4,2], [3,1], [5,1]]:
n:= nops(pts):
GT:= GraphTheory: LA:= LinearAlgebra:
G:= (GT:-Graph@Matrix)(
n+1,
(i,j)-> if(i=j, 0, if(i>n or j>n, 1, LA:-Norm(<pts[i]-pts[j]>, 2))),
shape= symmetric, datatype= hfloat
):
(MinDist, HamPath):= GT:-TravelingSalesman(G, startvertex= n+1):
MinDist-= 2; HamPath:= HamPath[2..-2];
MinDist := 7.30056307974577
HamPath := [1, 2, 4, 3, 5]
#Plot:
GT:-SetVertexPositions(H, pts);
GT:-HighlightTrail(H, HamPath);
GT:-DrawGraph(H, axes= frame, scaling= constrained);


## Wrong software forum...

I think you're posting in the wrong forum. As far as I know, no Meplesoft product has a subpart named "Workday".

## How did ChatGPT come up with LinearSumAs...

I wonder how ChatGPT came up with the non-existent command Optimization:-LinearSumAssignment. It had to have read that somewhere; it doesn't just make up fake Maple command names on a whim.

## unames...

@C_R The command that you're thinking of is called unames.

## I've noticed speed improvement...

@Scot Gould I've also noticed a speed improvement the past day or two

## Resetting the counter...

@nm The counter can be reset, without using restart, by

tools/genglobal[1](_C, 1, reset);

That form of the command just does the reset without returning a name. So, the next call to tools/genglobal(_C) will return _C1.

## It's not just you...

@Scot Gould I've experienced the same thing as you: The norification flag used to do something (not something that I find useful---but that's beside the point) and now it just says Loading.

## Help page...

See the help page ?simplify,size.

## Not really necessary...

@mmcdara Those two things are not necessary for your example, but might be needed for some generalization that you have in mind. What I can't figure out is why assigning invfunc[phi] doesn't require the unprotect, but assigning both invfunc[phi] and invfunc[invphi] does require it.

## Implementation...

The use of invfunc can be implemented like this:

restart:
phi:= u-> (u^(-theta)-1)/theta:
invphi:= unapply(solve(phi(x)=u, x), u):
unprotect(invfunc): invfunc[phi]:= invphi: invfunc[invphi]:= phi: protect(invfunc):
C:= (u,v)-> simplify((phi@@(-1))(phi(u)+phi(v))):
C(u,v);

To understand better what's going on here, check out showstat(@@).

## Connection to Maple?...

@janhardo I don't find it at all surprising that ChatGPT can give you an extensive discussion of the infinitude of primes, which is one of the most-ancient topics of formal abstract mathematics. But how does it involve Maple or any computer language?

## Yes...

Yes, I have noticed that most operations on MaplePrimes have been much slower for a few weeks.

## Post followups here...

I deleted your Question from today because it is essentially the same as this one. If you have additional information, put it in this thread.

## Dangerous for types to return errors...

@Preben Alsholm Indeed, "contrived".

A type check (including those constructed with satisfies) should only return either true or false; returning anything else including errors is a bad idea, and in some situations can be critically dangerous (such as causing kernel death). This includes all type checks, not just those used for checking calling sequences.

And, the overload mechanism reacts only to error messages beginning with "invalid input", which your parse error does not. The help page line that you quoted is thus wrong, and should be corrected. So, IMO, the only bug is that erroneous statement in the help page.

## The culprit is implicit multiplication...

@sand15 The culprit is implicit multiplucation in input; it shouldn't be allowed in 2D Input. I'm not saying that a multiplication operator should be explicitly shown in the input, just that the user should be requited to enter an operator.

 1 2 3 4 5 6 7 Last Page 3 of 689
﻿