if pred and len(list(pred)) > 0:
            weight = max([it[2].get('weight') for it in pred]) + 1