lcz

620 Reputation

10 Badges

3 years, 89 days
changsha, China

MaplePrimes Activity


These are replies submitted by lcz

@Carl Love I used the following commands and I can see the generated graphs (with graph6  type) in the error messages, but the reason for the error is unknown to me.

L2:=ImportGraph(ssystem("D:/nauty27r3/geng -c -b 6 -g"),graph6, output=list):

Error, invalid input: GraphTheory:-ImportGraph expects its 1st argument, filename, to be of type {string, symbol}, but received [0, "E?Bw\nE?bo\nE?qo\nE?ro\nE?ow\nE?zO\nE?zo\nE?~o\nECR_\nECr_\nECZ?\nECZ_\nEEr_\nEEh_\nEEj_\nEEz_\nEFz_"]

L2:=Import(ssystem("!D:/nauty27r3/geng -c -b 5 -g"),graph6,output=list):

Error, invalid input: Import expects value for keyword parameter output to be of type {DataFrame, DataSeries, identical(anything,auto,DataFrame,DataSeries,Graph,plot,string,table,triangles,Array,Matrix,Vector,Vector[column],Vector[row],AudioTools:-Audio,ByteArray,ImageTools:-Image,Logic,logical,boolean_function,embed,html,xml)}, but received list

  @acer t's the first time I've seen it handled so beautifully. With your help, the following code works very well.

restart;
with(GraphTheory):
DrawGraph(CompleteGraph(10), layout = interactive,
          layoutoptions = [neutral_color = "pink", initial = spring],
          stylesheet = [vertexpadding=10,edgethickness=2,edgecolor= SteelBlue]):

@acer Sorry, I have added more details in the question. In general, the matrices I encounter are real symmetric, and the strange thing is that I don't see a command to evaluate all  numeric eigenvalues of a matrix so far.

@Carl Love Thank you for your explanation.  It is really not a good habit to delete a post that others have commented on easily, even if some posts may be belong themselves.This requires good website mechanics rather than ethical constraints.

@janhardo I think deleting a post should require 2-3 qualified members to evaluate it. MaplePrimes should  learn from mathematics stack, which can show close not to accept comments or accept rechanges rather than disappear when a question or post is not good.

In maple 2022,   IsSubgraphIsomorphic adds a  option "isomorphism"  for checking, but unfortunately returns incorrect results when the option "isomorphism" is not selected.

with(GraphTheory):
T:=DeleteEdge(CompleteGraph(7),{{1,2},{2,3},{3,1}},inplace= false): 
G:=DeleteEdge(CompleteGraph(8),{{1,2},{2,3},{3,4},{4,5},{5,6}},inplace= false): 
IsSubgraphIsomorphic(T,G);
IsSubgraphIsomorphic(T,G,isomorphism)

true

false

@acer Great! I found the size of vertex in the interactive graph  is small. So I tried to use the a option vertexpadding=30, but it was disappointing and didn't work.

with(GraphTheory):
# not work
DrawGraph(CompleteGraph(10), layout = interactive, layoutoptions = [neutral_color = "pink", initial = spring],stylesheet = [vertexpadding=30]):

# it works
DrawGraph(CompleteGraph(10), stylesheet = [vertexpadding=30]):

This is a problem that I mentioned before, including the thickness of the edges, that can't be adjusted very well. See https://www.mapleprimes.com/questions/232788--Interactive-And-Stylesheet--Conflict

@Kitonum  Thank you,  and there is nothing wrong with your code. But it's not  close to what I want. My motivation for the problem is this: sometimes the default layouts of graphs are hard to see some  substructures with some particular properties.  So I need to modify it slightly. This is particularly critical in the presentation of planar graph.

Interactive graph layout method  seems to have been introduced in  maple 2020. The Interactive layout method creates an interactive plot component with a drawing of the Graph that can have the vertices repositioned by click, or clicking and dragging.

@dharr  Thank you for letting me know. I checked the paper and  indeed  the author deduce the result you said.

Since  L+(1/n)*J is reversible, it is much faster, also as Carl Love said.

@Carl Love Your improved code is very clean and effective.
Using the pseudo-inverse method, the resistance distance between all vertices will be found at once. There will be huge wear and tear. An interesting question is whether there is a good way if we only want to know the resistance distance between two vertices.

@Joe Riel  The author asks another question: 

and the graph in the question is  SoccerBallGraph. I I provided a solution based on  Moore–Penrose inverse of  Laplacian matrix of the graph. I am not a physics major, so I do not know the use of  Syrup package. I do not know how to solve  the resistance distance problem  of SoccerBallGraph by Syrup.

@Kitonum  Interesting, but could you prove that the summation in this problem must be in the form of a 3rd degree polynomial?

This is a good question, and perhaps mathematical induction can be tried. However, I suggest you can go to the mathematics stack to query the problem. There is more emphasis on mathematical proofs. If there is a relevant response, look forward to responding here.

@Carl Love Thanks for telling me. Following your suggestion, I added 1 to each element of the two-dimensional list, and the transformation was complete. 

with(GraphTheory):
glist:=[[1, 2, 3, 4, 5, 6], [0, 2, 3, 4, 7, 8],
 [0, 1, 3, 5, 7, 9], [0, 1, 2, 6, 8, 9],
 [0, 1, 5, 6, 7, 8], [0, 2, 4, 6, 7, 9], 
[0, 3, 4, 5, 8, 9], [1, 2, 4, 5, 8, 9], 
[1, 3, 4, 6, 7, 9], [2, 3, 5, 6, 7, 8]]
:
adjustlist_g:=Matrix(glist)+~1:#adjust 
G := Graph([$0..9],convert(adjustlist_g,listlist)):
DrawGraph(G)

 

 

@Carl Love  That's it, I understand 😀.  This representation of graph in maple does not seem to conform to the usual custom.

1 2 3 4 5 6 7 Last Page 1 of 10