lcz

994 Reputation

11 Badges

6 years, 131 days
changsha, China

MaplePrimes Activity


These are questions asked by lcz

I'm thinking of better demonstrating the cartesian product of a graph.
With the help documentation, we can easily find the cartesian product of two graphs.

with(GraphTheory):
G := CycleGraph([v__1,v__2,v__3,v__4]);
H:=Graph({{u__1,u__2}}):
DrawGraph(G,size=[250,250],stylesheet=[vertexborder=false,vertexpadding=10,edgecolor = "Red",
vertexcolor="navy",edgethickness=3]);
DrawGraph(H,size=[250,250],stylesheet=[vertexborder=false,vertexpadding=10,edgecolor = "Blue",
vertexcolor="Gold",edgethickness=3]);


GH:=CartesianProduct(G,H)
DrawGraph(GH,style=spring)

 

 

 

When I saw Wikipedia's demo diagram, https://en.wikipedia.org/wiki/Cartesian_product_of_graphs

I was fascinated,and I also wanted to visually reflect the nature of Cartesian product by doing different staining of vertices.
It is easy for me to dye the vertices in one color, but it is difficult for 
two different colors .

 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

First 15 16 17 18 19 20 21 Last Page 17 of 25