lcz

994 Reputation

11 Badges

6 years, 129 days
changsha, China

MaplePrimes Activity


These are questions asked by lcz

Hello:
I have a set like following:

               Set:={{1, 2}, {1, 3}, {1, 4}, {2, 3}};
I want to determine number of every member of set?
for example:  1 appears 3 times. 2 appears 2 times,
3 appears 2 times , 4 appears 1 time.

How to do?

Hi:
 I use the following codes:
with(GraphTheory):
Graphs_data3:=[NonIsomorphicGraphs(6,restrictto =[connected], output
= graphs, outputform =graph)]:
Diameter2_select:=select[flatten](t->Diameter(t)=2,Graphs_data3):
map(DrawGraph,Diameter2_select);
nops(Diameter2_select);

Since  59 graphs are not many, so,I want to display  it. But the list show that
[Length of output exceeds limit of 1000000]`
How do I do?

If I use DrawGraph(Diameter2_select), the output is to large, and it is  not convenient to print it out .

 

 We know the following facts: 

The SequenceGraph command returns a graph with the specified degree sequence given as input, if such a graph exists. It raises an exception otherwise. 
 But  If I  want to get more graphs  that satisfy this condition of degree sequence ? (If graphs are not many ,I want get all graphs better)
what should I do.?
For example: DrawGraph(SequenceGraph([3, 2, 2, 1, 1, 1]));  It returns the first graph below, but it is obvious that the second graph also fits the condition.

squenceGraph.mw

  I want list all  diameter-2  Nonisomorphismgraphs  of order n . I use the following code, but its running speed  is slow with  order of graph gradually increasing . (for example,n=10)
 Are there other ways to Improve it? 
restart:
with(GraphTheory):
Graphs_data:=[NonIsomorphicGraphs(4,restrictto =[connected], output = graphs, outputform =graph)]:
Diameter_select:=select[flatten](t->Diameter(t)=2,Graphs_data):
DrawGraph(Diameter_select,size=[50,50]);

  By the way,  Why doesn't size=[50,50] work ?

 
                       
                   
               
               
           
           
               
                   
                 

  Hello: 
     We know The FindMaximalElement(L) function returns the largest element of the list L .
   My questions is  How do I find the second largest element in a list and its index?  
     Since there are so many lists to consider , Algorithmic Complexity may be as low as possible.
     More generally, we want to find the third-largest  element and so on.
     For instance, Given a list [3,2,3,6,8], we want to get 6 and 4 , since 6 is the  second largest element and 4 is its index. 
    Thank you in advance for your help.
  Licheng

First 22 23 24 25 Page 24 of 25