import numpy as np

W = np.array([
    [0.6, 0.1, 0.1, 0.1, 0.1],
    [0.1, 0.6, 0.1, 0.1, 0.1],
    [0.1, 0.1, 0.6, 0.1, 0.1],
    [0.1, 0.1, 0.1, 0.6, 0.1],
    [0.1, 0.1, 0.1, 0.1, 0.6]])
print(f"W:\n{W}")

u = np.array([[0.6], [0.5], [0.6], [0.2], [0.1]])
print(f"u:\n{u}")

M = np.array([
    [-0.125, 0, 0.125, 0.125, 0],
    [0, -0.125, 0, 0.125, 0.125],
    [0.125, 0, -0.125, 0, 0.125],
    [0.125, 0.125, 0, -0.125, 0],
    [0, 0.125, 0.125, 0, -0.125]
])
print(f"M:\n{M}")

h = W * u
print(f"h:{h}")

ev, e = np.linalg.eig(M)
print(f"ev:{ev}")
print(f"e:{e}")

v_ss= ((np.dot(h.T, e) / (1 - ev))* e)
print(np.sum(v_ss, axis=0))
# [0.57468284 0.46104003 0.5556308  0.35789389 0.33646672]