def test_claw_leaves(m,i,j,k):
return m.rows()[i][j] == 0 and m.rows()[j][k] == 0 and m.rows()[k][i] == 0
def test_claw_free(m):
for i in [0..len(m.rows())-1]:
pot_leaves = subset_size_n(neighborhood(m,i),3)
for s in pot_leaves:
if test_claw_leaves(m,s[0],s[1],s[2]) == True:
return False
return True