Robust PD for Trees - With Deg 3 Modification

1424 days ago by bjorkman

Beth Bjorkman Iowa State University April 2020 
       
URL='https://raw.githubusercontent.com/jephianlin/mr_JG/py2/' files=['Zq_c.pyx','Zq.py','zero_forcing_64.pyx','zero_forcing_wavefront.pyx','minrank.py', 'inertia.py'] for f in files: print("Loading %s..."%f); load(URL+f) 
       
Loading Zq_c.pyx...
Compiling
/home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_tUAJ8v.pyx..\
.
Loading Zq.py...
Loading zero_forcing_64.pyx...
Compiling
/home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_jt4nRe.pyx..\
.
Loading zero_forcing_wavefront.pyx...
Compiling
/home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_WAV04s.pyx..\
.
Loading minrank.py...
Loading inertia.py...
Loading Zq_c.pyx...
Compiling /home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_tUAJ8v.pyx...
Loading Zq.py...
Loading zero_forcing_64.pyx...
Compiling /home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_jt4nRe.pyx...
Loading zero_forcing_wavefront.pyx...
Compiling /home/sageuser/2/.sage/temp/sage.math.iastate.edu/15006/tmp_WAV04s.pyx...
Loading minrank.py...
Loading inertia.py...
 
       
# input: a graph G and a subset of its vertices V # ouput: true/false depending if V is a power dominating set of G def isPowerDominatingSet(G,V): N=[] for i in V: N+=G.neighbors(i) NVert=uniq(N+list(V)) A=zerosgame(G,NVert) if len(A)==G.order(): return True else: return False # input: a graph G # output: the power domination number of G def PowerDomNum(G): V = G.vertices() for i in range(1,len(V)+1): S = subsets(V,i) for s in S: if isPowerDominatingSet(G,s): p=len(s) return p # input: a graph G # output: a power dominating set of G that achieves the power domination number def minPowerDominatingSet(G): V = G.vertices() for i in range(1,len(V)+1): S = subsets(V,i) for s in S: if isPowerDominatingSet(G,s): return s ################################################################################### # input: a graph G # output: a power dominating set of G that achieves the power domination number def FixminPowerDominatingSet(G): V = G.vertices() for i in range(1,len(V)+1): S = subsets(V,i) for s in S: #print s if FixisPowerDominatingSet(G,s): return s # input: a graph G # output: the power domination number of G def FixPowerDomNum(G): V = G.vertices() for i in range(1,len(V)+1): S = subsets(V,i) for s in S: #print s if FixisPowerDominatingSet(G,s): p=len(s) return p # input: a graph G and a subset of its vertices V # ouput: true/false depending if V is a power dominating set of G def FixisPowerDominatingSet(G,V): N=[] for i in V: #print "S=", V N+=G.neighbors(i) NVert=uniq(N+list(V)) #print "N closed neighbors", NVert A=zerosgame(G,NVert) if len(A)==G.order(): return True else: return False 
       
# input: a graph G, integer k>=0 # output: a k-robust power dominating set of G that achieves the krPDS number def kPowDomSet(G,k): V=G.vertices() #print V powdomnum = FixPowerDomNum(G) uppbound = powdomnum*(k+1) lowbound = k+powdomnum multilist = V*(k+1) #print "lowbound: ", lowbound, " uppbound: ", uppbound for setsize in range(lowbound,uppbound+1): goodpmus=setsize-k #print "goodpmus is", goodpmus PossibleS = list(Subsets(multilist, setsize, submultiset=True)) #all possible multisets for size setsize for S in PossibleS: #print "S is ", S SminusRlist=list(Subsets(S, goodpmus, submultiset=True)) #print "SminusRlist is ", SminusRlist goodsets=0 for SminusR in SminusRlist: if FixisPowerDominatingSet(G,list(uniq(SminusR))): goodsets+=1 if goodsets==len(SminusRlist): #print "got one!" return len(S), S, powdomnum 
       
# input: a graph G, integer k>=0 # output: a k-robust power dominating set of G that achieves the krPDS number # output: len(S) = size of min k pow dom set, S= min kpow dom set, powdomnum=power domination number # output: if have pow dom num =1 or 2, just gives 0, [], 0 because these always achieve upper bound anyway def BIGkPowDomSet(G,k): V=G.vertices() #print V powdomnum = FixPowerDomNum(G) #print powdomnum if powdomnum>3: #print "woo" uppbound = powdomnum*(k+1) lowbound = k+powdomnum multilist = V*(k+1) #print "lowbound: ", lowbound, " uppbound: ", uppbound for setsize in range(lowbound,uppbound+1): goodpmus=setsize-k #print "goodpmus is", goodpmus PossibleS = list(Subsets(multilist, setsize, submultiset=True)) #all possible multisets for size setsize for S in PossibleS: #print "S is ", S SminusRlist=list(Subsets(S, goodpmus, submultiset=True)) #print "SminusRlist is ", SminusRlist goodsets=0 for SminusR in SminusRlist: if FixisPowerDominatingSet(G,list(uniq(SminusR))): goodsets+=1 if goodsets==len(SminusRlist): #print "got one!" return len(S), S, powdomnum else: return 0,[],0 
       
 
       
################# Function to check graphs given that if maxdeg>=3, kpds can use only deg>=3 vertices # input: a graph G, integer k>=0 # output: a k-robust power dominating set of G that achieves the krPDS number # output: len(S) = size of min k pow dom set, S= min kpow dom set, powdomnum=power domination number # output: if have pow dom num =1 or 2, just gives 0, [], 0 because these always achieve upper bound anyway def DEGkPowDomSet(G,k): V=G.vertices() powdomnum = FixPowerDomNum(G) if powdomnum>3: uppbound = powdomnum*(k+1) lowbound = k+powdomnum highdegvert = [] for vertex in tree.vertices(): deg=tree.degree(vertex) if deg>=3: highdegvert.append(vertex) multilist=highdegvert*(k+1) #print "lowbound: ", lowbound, " uppbound: ", uppbound for setsize in range(lowbound,uppbound+1): goodpmus=setsize-k #print "goodpmus is", goodpmus PossibleS = list(Subsets(multilist, setsize, submultiset=True)) #all possible multisets for size setsize for S in PossibleS: #print "S is ", S SminusRlist=list(Subsets(S, goodpmus, submultiset=True)) #print "SminusRlist is ", SminusRlist goodsets=0 for SminusR in SminusRlist: if FixisPowerDominatingSet(G,list(uniq(SminusR))): goodsets+=1 if goodsets==len(SminusRlist): #print "got one!" return len(S), S, powdomnum else: return 0,[],0 
       
 
       
 
       
 
       
############## RUNNING DEGkPowDomSet on Trees k=1 treesn=list(graphs.trees(n)) for n in range(14,21): print "-------------------------------------" print "Testing trees on ",n," vertices" treesn=list(graphs.trees(n)) print "Number to test:", len(treesn) check=0 for tree in treesn: modby=ceil(len(treesn)*.10) if treesn.index(tree)%modby==0: print treesn.index(tree),"trees checked (",check*10, "%)" check+=1 #print PowerDomNum(tree) #show(tree) #kpowdomnum=0 #kpowdomset=None #powdomnum=0 kpowdomnum,kpowdomset,powdomnum=DEGkPowDomSet(tree,k) uppbound= powdomnum*(k+1) if uppbound !=kpowdomnum: print "Got a tree not achieving the upper bound!" print "vertices:", n print "tree index:", treesn.index(tree) print "k=",k print "power domination number:", powdomnum print "(k+1)sp(T) bound: ", uppbound print "k-rPDS: ", kpowdomnum print "k-rPDS set:", kpowdomset show(tree) #else: # print "Achieves upper bound!" print "DONE" 
       
-------------------------------------
Testing trees on  14  vertices
Number to test: 3159
0 trees checked ( 0 %)
^C
Traceback (click to the left of this block for traceback)
...
__SAGE__
-------------------------------------
Testing trees on  14  vertices
Number to test: 3159
0 trees checked ( 0 %)
^C
Traceback (most recent call last):        print "-------------------------------------"  
  File "", line 1, in <module>
    
  File "/tmp/tmpM0Wj49/___code___.py", line 15, in <module>
    if treesn.index(tree)%modby==_sage_const_0 :
  File "/home/sage/build/sage-8.1/local/lib/python2.7/site-packages/sage/graphs/generic_graph.py", line 511, in __eq__
    for edge in self.edge_iterator(labels=self._weighted))
  File "src/cysignals/signals.pyx", line 251, in cysignals.signals.python_check_interrupt
  File "src/cysignals/signals.pyx", line 94, in cysignals.signals.sig_raise_exception
KeyboardInterrupt
__SAGE__
for n in range(6,15): for k in range(2,11): print "-------------------------------------" print "Testing trees on ",n," vertices for k=", k treesn=list(graphs.trees(n)) print "Number to test:", len(treesn) check=0 for tree in treesn: modby=ceil(len(treesn)*.25) if treesn.index(tree)%modby==0: print treesn.index(tree),"trees checked (",check*25, "%)" check+=1 #print PowerDomNum(tree) #show(tree) #kpowdomnum=0 #kpowdomset=None #powdomnum=0 kpowdomnum,kpowdomset,powdomnum=DEGkPowDomSet(tree,k) uppbound= powdomnum*(k+1) if uppbound !=kpowdomnum: print "Got a tree not achieving the upper bound!" print "vertices:", n print "tree index:", treesn.index(tree) print "k=",k print "power domination number:", powdomnum print "(k+1)sp(T) bound: ", uppbound print "k-rPDS: ", kpowdomnum print "k-rPDS set:", kpowdomset show(tree) break #else: # print "Achieves upper bound!" print "DONE" 
       
WARNING: Output truncated!  


-------------------------------------
Testing trees on  6  vertices for k= 2
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 3
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 4
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 5
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 6
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 7
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 8
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 9
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 10
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  7  vertices for k= 2
Number to test: 11
0 trees checked ( 0 %)
3 trees checked ( 25 %)

...

0 trees checked ( 0 %)
326 trees checked ( 25 %)
652 trees checked ( 50 %)
978 trees checked ( 75 %)
-------------------------------------
Testing trees on  13  vertices for k= 10
Number to test: 1301
0 trees checked ( 0 %)
326 trees checked ( 25 %)
652 trees checked ( 50 %)
978 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 2
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 3
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 4
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 5
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 6
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 7
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 8
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
WARNING: Output truncated!  


-------------------------------------
Testing trees on  6  vertices for k= 2
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 3
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 4
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 5
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 6
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 7
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 8
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 9
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  6  vertices for k= 10
Number to test: 6
0 trees checked ( 0 %)
2 trees checked ( 25 %)
4 trees checked ( 50 %)
-------------------------------------
Testing trees on  7  vertices for k= 2
Number to test: 11
0 trees checked ( 0 %)
3 trees checked ( 25 %)

...

0 trees checked ( 0 %)
326 trees checked ( 25 %)
652 trees checked ( 50 %)
978 trees checked ( 75 %)
-------------------------------------
Testing trees on  13  vertices for k= 10
Number to test: 1301
0 trees checked ( 0 %)
326 trees checked ( 25 %)
652 trees checked ( 50 %)
978 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 2
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 3
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 4
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 5
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 6
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 7
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
-------------------------------------
Testing trees on  14  vertices for k= 8
Number to test: 3159
0 trees checked ( 0 %)
790 trees checked ( 25 %)
1580 trees checked ( 50 %)
2370 trees checked ( 75 %)
p4=graphs.PathGraph(4) p2=graphs.PathGraph(2) g=p2.strong_product(p4) FixkPowDomSet(g,2) 
       
 
       
p4=graphs.PathGraph(4) 
       
Traceback (click to the left of this block for traceback)
...
NameError: name 'isPowerDominatingSet' is not defined
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_8.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cDQ9Z3JhcGhzLlBhdGhHcmFwaCg0KQppc1Bvd2VyRG9taW5hdGluZ1NldChwNCxbMV0p"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpo_sDYb/___code___.py", line 4, in <module>
    exec compile(u'isPowerDominatingSet(p4,[_sage_const_1 ])
  File "", line 1, in <module>
    
NameError: name 'isPowerDominatingSet' is not defined
 
       
L=list(graphs.trees(10)) #print(len(L)) for tree in L: maxdeg=max(tree.degree_sequence()) if maxdeg < 3: L.remove(tree) #print(len(L)) for tree in L: highdegvert=[] for vertex in tree.vertices(): deg=tree.degree(vertex) if deg>=3: highdegvert.append(vertex) print highdegvert 
       
WARNING: Output truncated!  
full_output.txt



Graph on 10 vertices
[3]
Graph on 10 vertices
[3, 7]
Graph on 10 vertices
[2]
Graph on 10 vertices
[2, 7]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[1]
Graph on 10 vertices
[1, 7]
Graph on 10 vertices
[1, 6]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0]
Graph on 10 vertices
[6]
Graph on 10 vertices
[5, 6]
Graph on 10 vertices
[0, 6]
Graph on 10 vertices
[5]
Graph on 10 vertices
[5]
Graph on 10 vertices
[0, 5]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[2]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[2, 7]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[0, 2]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[1, 2, 7]
Graph on 10 vertices
[1, 2, 6]
Graph on 10 vertices
[0, 1, 2]
Graph on 10 vertices

...

Graph on 10 vertices
[0, 4]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[1]
Graph on 10 vertices
[1, 7]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[1, 6]
Graph on 10 vertices
[0, 1, 6]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1, 4, 7]
Graph on 10 vertices
[0, 1, 4]
Graph on 10 vertices
[0, 1, 4]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
WARNING: Output truncated!  
full_output.txt



Graph on 10 vertices
[3]
Graph on 10 vertices
[3, 7]
Graph on 10 vertices
[2]
Graph on 10 vertices
[2, 7]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[1]
Graph on 10 vertices
[1, 7]
Graph on 10 vertices
[1, 6]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0]
Graph on 10 vertices
[6]
Graph on 10 vertices
[5, 6]
Graph on 10 vertices
[0, 6]
Graph on 10 vertices
[5]
Graph on 10 vertices
[5]
Graph on 10 vertices
[0, 5]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[2]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[2, 7]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[0, 2]
Graph on 10 vertices
[2, 6]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[1, 2]
Graph on 10 vertices
[1, 2, 7]
Graph on 10 vertices
[1, 2, 6]
Graph on 10 vertices
[0, 1, 2]
Graph on 10 vertices

...

Graph on 10 vertices
[0, 4]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[1]
Graph on 10 vertices
[1, 7]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[1, 6]
Graph on 10 vertices
[0, 1, 6]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1, 5]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1, 4, 7]
Graph on 10 vertices
[0, 1, 4]
Graph on 10 vertices
[0, 1, 4]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0, 1]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
Graph on 10 vertices
[0]
 
       
Traceback (click to the left of this block for traceback)
...
SyntaxError: invalid syntax
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "_sage_input_16.py", line 10, in <module>
    exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("KCk+PTM6CiAgICAgICAgICAgIEwuYXBwZW5kKHZlcnRleCkKICAgIHByaW50IGhpZ2hkZWd2ZXJ0"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
  File "", line 1, in <module>
    
  File "/tmp/tmpMJ3dof/___code___.py", line 3
    ()>=_sage_const_3 :
                      ^
SyntaxError: invalid syntax