Graph.py
def decrease_key(self,i,k):
        '''
        caution : here to assume that k is small than A[i]
        '''
        if k >= self.A[i].d:
            print('k should be smaller than A[i], exit.')
            return
        self.A[i].d = k
        p = self.parent(i)
        while p >= 0 and self.A[p].d > self.A[i].d:
            self.A[i], self.A[p] = self.A[p], self.A[i]
            i = p
            p = self.parent[i]

        caution : here to assume that k is small than A[i]
        
caution : here to assume that k is small than A[i]
caution : here to assume that k is small than A [ i ]
def decrease_key(self,i,k):
        if k >= self.A[i].d:
            print('k should be smaller than A[i], exit.')
            return
        self.A[i].d = k
        p = self.parent(i)
        while p >= 0 and self.A[p].d > self.A[i].d:
            self.A[i], self.A[p] = self.A[p], self.A[i]
            i = p
            p = self.parent[i]
def decrease_key ( self , i , k ) : if k >= self . A [ i ] . d : print ( 'k should be smaller than A[i], exit.' ) return self . A [ i ] . d = k p = self . parent ( i ) while p >= 0 and self . A [ p ] . d > self . A [ i ] . d : self . A [ i ] , self . A [ p ] = self . A [ p ] , self . A [ i ] i = p p = self . parent [ i ]
caution : here to assume that k is small than A[i]
caution : here to assume that k is small than A [ i ]
'''
        caution : here to assume that k is small than A[i]
        '''
self
i
k