SymPy | Prufer.next() in Python
Prufer.next() : next() is a sympy Python library function that returns the Prufer sequence that is delta beyond the current one.
Syntax :
sympy.combinatorics.Prufer.prufer.next()
Return :
Prufer sequence that is delta beyond the current one
Code #1 : next() Example
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.prufer import Prufer
a = Prufer([ 1 , 2 , 3 ], [ 2 , 4 , 5 ])
print ( "Prufer a next : " , a. next ( 1 ))
|
Output :
Prufer a next : Prufer([1, 2, 4])
Code #2 : next() Example
from sympy.combinatorics import Permutation, Cycle
from sympy.combinatorics.prufer import Prufer
b = Prufer([ 1 , 2 , 3 , 2 , 4 , 5 ], [ 6 , 7 ], [ 8 ])
print ( "Prufer b next : " , b. next ( 1 ))
|
Output :
Prufer b next : Prufer([1, 2, 3, 2, 4, 6])
Last Updated :
28 Aug, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...