lcz

1039 Reputation

12 Badges

6 years, 163 days
changsha, China

MaplePrimes Activity


These are questions asked by lcz

 I'm thinking about a question about counting the total number of Eulerian trails of following graphs . 

The Seven Bridges in Gonisburg lost one bridge due to war. 

G-e7

We looked up on Wikipedia to  add some details..

For the existence of Eulerian trails it is necessary that zero or two vertices have an odd degree; this means the Königsberg graph is not Eulerian. If there are no vertices of odd degree, all Eulerian trails are circuits. If there are exactly two vertices of odd degree, all Eulerian trails start at one of them and end at the other. A graph that has an Eulerian trail but not an Eulerian circuit is called semi-Eulerian.

It's easy to know that G-e7 is semi-Eulerian. So I want find all Eulerian trails. A simple attempt, found the following one in graph (Pink label).

I feel a little tricky dealing with this through Maple. The first reason is that the Maple graph theory package does not support parallel edges. Unfortunately, eand e6 are parallel edges of G-e7.

To take a step back, what if there are no parallel edges? For considering G-e7-e6.

There are some built-in commands related like FindEulerianPath , but can only find a Euler circuits.

 

 

 

 


I tried to simplify it, but It didn't work that well.

simplify(%)

 

I always feel that this formula can be further simplified, but there is no way to start. Of course, My thoughts maybe incorrect. maybe this is the simplest form.

 

 

 

 

 

 

I have an expression  

product(q^(n -2)- q^i, i = 0 .. r )/product(q^(n-2) - q^(i+1), i = 0 .. r)

 

Obviously, it can be further simplified.

But in maple I can't do that, I use simplify and expand , all failed.

simplify(expand(%))

What should I do to get the simplified result I want?

 

I'd like to convert  every row of matrix to list, but failed.  I want to use batch operations map(~) not for-loop.

data:=Matrix(3, 5, [[2, -6, 3, 0, 0], [5, -2, 4, 1, 2], [17, -4, 10, 20, 99]])

Matrix(3, 5, {(1, 1) = 2, (1, 2) = -6, (1, 3) = 3, (1, 4) = 0, (1, 5) = 0, (2, 1) = 5, (2, 2) = -2, (2, 3) = 4, (2, 4) = 1, (2, 5) = 2, (3, 1) = 17, (3, 2) = -4, (3, 3) = 10, (3, 4) = 20, (3, 5) = 99})

(2)

convert~(data,list)

Matrix(3, 5, {(1, 1) = [2], (1, 2) = [-6], (1, 3) = [3], (1, 4) = [0], (1, 5) = [0], (2, 1) = [5], (2, 2) = [-2], (2, 3) = [4], (2, 4) = [1], (2, 5) = [2], (3, 1) = [17], (3, 2) = [-4], (3, 3) = [10], (3, 4) = [20], (3, 5) = [99]})

(3)

convert(data,list)

[2, 5, 17, -6, -2, -4, 3, 4, 10, 0, 1, 20, 0, 2, 99]

(4)

The expected output is the following:

                        [2, -6, 3, 0, 0]
                        [5, -2, 4, 1, 2]
                      [17, -4, 10, 20, 99]

 

 

 

Download ss.mw

Unfortunately,  Optimization:-Maximize command in following example returns a not precise result (I use Maple 2020).

restart:
s1:= Optimization:-Maximize((x-2*y)/(5*x^2-2*x*y+2*y^2), {2*x^2 - y^2 + x*y=1})

Maple is running the following results:

I read help of  Maximize, It seems to be using only numerical methods .

 

The Minimize and Maximize commands use various methods implemented in a built-in library provided by the Numerical Algorithms Group (NAG). 

 

Can't Maple find a symbolic solution for extreme values under such constrained inequality or equality conditions?

Ps:

For the correct  symbolic  solution, we can try to  use Mathematica 12.

Maximize[{(x - 2*y)/(5*x^2 - 2*x*y + 2*y^2), 
  2*x^2 - y^2 + x*y == 1}, {x, y}]

  We can compare numerical sizes of Optimal solution between maple and mathematica. 

Digits:=20;
sqrt(2.)/4.

Another Problem:

If I accept numerical solutions of maple ,how do I estimate errors without knowing the exact solution ?

 

 

 

First 16 17 18 19 20 21 22 Last Page 18 of 26