sursumCorda

922 Reputation

13 Badges

2 years, 206 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@acer Thanks. I find that the following codes are more or less convenient: 

[`$`](''parse(DocumentTools:-Tabulate([sprintf("%ld", i)], 'exterior' = 'none'), 'noeval', 'statement'), ifactors(2^i - 1)[-1]'', 'i' = 190 .. 200); DocumentTools:-Tabulate([[]]): 

@lcz SVG is an XML-based text format. So the connection between .svg and .xml is, in effect, closer.

In this question@Carl Love posted an example of finding one shortest possible tour through several 3D points. His code only took he around four minutes, and just took @dharr about six minutes. Unexpectedly, executing it takes me nigh on 9 min! Well, these may be determined by one's computer. But how about Steam Deck's performance?
 

restart;

pts := [[1, 1, 0], [3, 2, 0], [2, 3, 1], [1, 3, 1], [1, 4, 2], [1, 5, 0], [2, 5, 1], [3, 5, 3], [4, 5, 3], [3, 4, 5], [4, 3, 2], [5, 3, 2], [5, 4, 1], [5, 2, 1], [5, 1, 0], [4, 1, 2], [3, 1, 2], [2, 1, 2], [1, 2, 1]]

Matrix(`$`(numelems('pts'), 2), proc (i, j) options operator, arrow; linalg['norm'](pts[i]-pts[j], 1) end proc, shape = symmetric, datatype = integer[1])g := GraphTheory:-Graph(%)

_rtable[36893490071532186668]

g := `Graph 1: an undirected weighted graph with 19 vertices and 171 edge(s)`

(1)

cost, route := CodeTools:-Usage(GraphTheory:-TravelingSalesman(g))

memory used=19.08GiB, alloc change=54.00MiB, cpu time=9.44m, real time=8.71m, gc time=75.19s

costd, route := 42, [1, 19, 4, 3, 7, 6, 5, 10, 8, 9, 11, 12, 13, 14, 15, 2, 16, 17, 18, 1]

(2)

perm := pts[route]

perm := [[1, 1, 0], [1, 2, 1], [1, 3, 1], [2, 3, 1], [2, 5, 1], [1, 5, 0], [1, 4, 2], [3, 4, 5], [3, 5, 3], [4, 5, 3], [4, 3, 2], [5, 3, 2], [5, 4, 1], [5, 2, 1], [5, 1, 0], [3, 2, 0], [4, 1, 2], [3, 1, 2], [2, 1, 2], [1, 1, 0]]

(3)

kernelopts(version);

`Maple 2022.2, X86 64 WINDOWS, Oct 23 2022, Build ID 1657361`

(4)


 

Download testTSP.mws (Sorry for a typo in it.) 

The selection works for sets as well.

@mmcdara For a small problem, minimizing the unsquared sum of actual distances (something like perpendicular offsets) remains possible in practice.

\begin{figure}\begin{center}\BoxedEPSF{LeastSquaresOffsets.epsf}\end{center}\end{figure}

But it seems that Maple haven't collected this method yet, so one has to implement these by hand!

@lcz Replace "\n" and/or "\t" between term and datum with " ". For example, 

fontName	"Dialog"

is replaced by 

fontName "Dialog"

and 

LabelGraphics
		[

is replaced by 

LabelGraphics [

 

@acer Thanks again. It's what I want.

@sand15 Cheers. I believe the "smooth" means "antialiased", but I'm unfamiliar with these technical terms, and don't know how to define them.

@lcz Thanks. Maybe Maple is more geared towards graph computations rather than graph representations. I'm not familiar with Gephi, but it looks superb. At present, if I really wanna plot a graph emphasizing layered structure in Maple, I have to specify the co-ordinates of the vertices manually only after obtaining vertex placement in Mathematica (using GraphEmbedding). This vexed matter is very irritating.

@sand15 I think that the third line is with(ComputationalGeometry):. Also, the boundary is less smooth, but this is a constructive approach indeed. Thanks!

@acer This time the boundary is very rough (in contrast to Mathematica's default output). However, these approaches are not so easy-to-use. (What about other possible ways?) It is often alleged that there exists an inverse relationship between the power of the tool and how easy it is to use. Still, I wish there to be a more intelligent Maple functionality in this respect.

@mmcdara Thanks as well. It seems that if we hope to transform a complicated plot, this approach may fail. Am I correct in saying this?

@acer Thanks very much. I never knew these before. But I wonder why plottools[transform] works in the first example instead. Any distinctions?

Are your codes correct? An error is issued at last:  By the way, running these on my computer takes about 32 minutes!

@C_R Thanks. It's very strange indeed—It appears that using the standard plot is always recommended.

First 15 16 17 18 19 Page 17 of 19