lcz

1039 Reputation

12 Badges

6 years, 161 days
changsha, China

MaplePrimes Activity


These are replies submitted by lcz

@Carl Love What I mean is that it may require further programming, such as generating some special graphs. For example Chordal graphs with 10 vertices, or planar graphs. It is true that we can use the select function, but it is not efficient all the time when the number vertices are more than 10.

It seems difficult to do with the options of this function NonIsomorphicGraphs. Temporary refers to perhaps future maple can easily do.

 

Sorry, it seems that it can be read directly.

I have always wanted to open it and have a look so I can select some graphs to read. 

I found that copy them and  paste to notepad++. Each data is starting to form a separate row again, which is strange.

@tomleslie Thank you very much for your patient guidance!

@tomleslie Thank you very much for your help. A single graph data in a text, run your code, great! But  If my data is all in one file, it seems that there will be some problems. The file is attached below:
graphdata.txt

I have very limited experience with text processing. Can you help me deal with it? I will learn a lot of relevant knowledge. Thanks!

@Carl Love Thanks for your advice! Cartesian product is particularly effective!

@Kitonum Awesome! It does work. For the additional problem of too many for loops in my program, is there any good way, I am very grateful!

@vv I understand what you mean, I just got it wrong

@vv Do you mean this result sqrt(2)*Pi^(5/2)*Zeta(5)^(2/9)/20 is wrong? But I have observed that it contains Pi, and Pi is also a transcendent number, will it affect it? In other words, is the product of two transcendental numbers also transcendental numbers?

@tomleslie Thanks a lot! This function evalc is very good, but based on the situation that I know 2*cos((2*Pi)/7) is one root of this function. how to remove the Arctangent function.

@Carl Love  awesome! It’s great, and it’s worth learning the coding skills.

@tomleslie Thank you, in the sense of isomorphism, only two more have been discovered, but they are already very good.

[ListTools[Categorize]((x,y)->GraphTheory[IsIsomorphic](x,y),G)]:
nops(%)

3

 

@Carl Love Thanks,Indeed, there is a problem with the code I wrote. 

with(GraphTheory):
with(SpecialGraphs):
numberof2Neighborhood:=(u,G)->local j;
add( `if`( Distance(G, u, j)=2,1,0), j in Vertices(G)):
P := PetersenGraph():
numberof2Neighborhood(1,P)

In order to let people later understand the error you pointed out, I did not modify the original reply. And your newly provided code is more efficient.

By the way, I think this is very similar to breadth first search. But the breadth-first search algorithm function and depth-first algorithm function seem to be not provided by maple.  This is a very strange phenomenon.

 

 

 

 

 

@vs140580 Perhaps you should choose Mapleinput not Math2D.

@vs140580 
 

with(GraphTheory):
with(SpecialGraphs):
numberof2Neighborhood:=(u,G)->local j;
add( `if`( Distance(P, u, j)=2,1,0), j in Vertices(G)):
P := PetersenGraph():
numberof2Neighborhood(1,P)

6

If you like, you can change the number 2 (distance) to k.

Ps:In addition, if the answer given by others fits your question, it should be adopted in mapleprimes.

 

 

 

What is exciting is Maple2021 introduces a new function IsSubgraphIsomorphic.

IsSubgraphIsomorphic: test for isomorphism against subgraphs of a graph. IsSubgraphIsomorphic tests whether a given graph is isomorphic to a subgraph of another given graph.

C6 := CycleGraph(6);
K24 := CompleteGraph(2, 4);
K33 := CompleteGraph(3, 3);
IsSubgraphIsomorphic(C6, K33);

However, it is a pity that I did not point out the isomorphic subgraph corresponding to the mother graph, so that it is impossible to check whether there is an error.

 

 

First 9 10 11 12 13 14 15 Page 11 of 17