lcz

1029 Reputation

11 Badges

5 years, 289 days
changsha, China

MaplePrimes Activity


These are questions asked by lcz

I tried connecting Maple to Jupyter Notebook, but it seems that it is not keen on outputting everything within the for loop; it only outputs the last item.

for i from 1 to 24 do
    print(i);
end do;

I've noticed that the Maple interface is always white, and after a long time, it causes eye strain. I wonder if it's possible to adjust the interface color, similar to Mathematica. My system is Windows 11.

Currently, I often use VSCode as an alternative, but some mathematical symbols don't display very clearly.

I have noticed similar discussions, such as this one, but I don’t know how to do it

I would like to remove isomorphs from some graphs. That is to filter out non-isomorphic graphs.

graph_list := [GraphTheory:-CompleteGraph(3), GraphTheory:-PathGraph(3),Graph({{a,b},{b,c},{c,a}})]:

# Create a table to store non-isomorphic graphs
non_isomorphic_graphs := table():

# Counter for indexing the table
counter := 1:

# Iterate over each graph and check if it is isomorphic to any of the stored graphs
for g in graph_list do
    is_isomorphic := false:
    for key in indices(non_isomorphic_graphs,'nolist') do
        if GraphTheory:-IsIsomorphic(g, non_isomorphic_graphs[key]) then
            is_isomorphic := true:
            break:
        end if:
    end do:
    if not is_isomorphic then
        non_isomorphic_graphs[counter] := g:
        counter := counter + 1:
    end if:
end do:
op(non_isomorphic_graphs)
DrawGraph~(non_isomorphic_graphs,  layoutoptions = [neutral_color = "pink", initial = spring])

 

A canonical form is a labeled graph Canon(G) that is isomorphic to G, such that every graph that is isomorphic to G has the same canonical form as G. I noticed that Maple has a function called CanonicalGraph. Can this function achieve the effect I want? I can easily achieve this by combining the  canonical form and property of sets  in  Sage.

graph_list = [Graph([(0, "a"), ("a", 2), (2, 0)]),graphs.PathGraph(3), graphs.CompleteGraph(3)]
non_isomorphic_graphs_labels = {g.canonical_label().copy(immutable=True) for g in graph_list}

 

 

An underlying motivation:My collaborators and I designed generation rules (algorithms) for 1-planar 4-trees;see https://arxiv.org/abs/2404.15663. Since the generating process is based on 1-planar embeddings, it will ultimately require filtering non-isomorphic graphs among a list of embeddings. I would be especially delighted to see that someone implement our algorithm in the future. Currently, I am stuck on handling some labeling details. It is somewhat similar to generating Apollonian networks (planar 3-trees). However, since its simplicial vertices are only two, the growth rate will not be too fast as the number of vertices increases.

AllGraphs is a new function in Maple 2024. Good things!

However, it seems that most of its functionalities are already provided by NonIsomorphicGraphs, and its speed even lags behind that of NonIsomorphicGraphs 

 

I'm curious about what truly sets this function apart from existing ones. It generates isomorphic graphs if nonisomorphic=falseBut I donot know what its application is. Supporting directed graphs is a new thing, but its speed is not well.

iterator := GraphTheory[AllGraphs](vertices = 6, edges =6..7, connected, nonisomorphic)
s:=[seq(p, p = iterator)]:
nops(s)

Note that this function is suitable for generating non-isomorphic connected graphs with 6 vertices and either 6 or 7 edges. It doesn't hold an advantage in terms of speed, andNonIsomorphicGraphs also provides an iteration option.

The (Induced) Subgraph Isomorphism computational problem is, given H and G, determine whether there is a (induced) subgraph isomorphism from H to G. See https://en.wikipedia.org/wiki/Induced_subgraph_isomorphism_problem

In Maple, IsSubgraphIsomorphic(G1,G2)  returns true if G1 is isomorphic to some subgraph of G2. However, it does not provide options for induced subgraphs. For example, 

with(GraphTheory):
claw:=CompleteGraph(1,3);
g:=CompleteGraph(2,2,2,2):
DrawGraph(g);
IsSubgraphIsomorphic(claw,g) #true

So the graph g contains a claw as a subgraph. But every claw in graph g  is non-induced. So g does not contain any induced claw. Maple does not appear to have this feature to determine if a graph contains a induced subgraph isomorphic to another graph. It is unclear whether we can modify some code in IsSubgraphIsomorphic  to achieve this goal.

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