rm CondaPkg environment

This commit is contained in:
ton
2023-04-06 13:53:47 +07:00
parent 0a57ed7884
commit c43d949309
3329 changed files with 5725 additions and 447022 deletions

View File

@@ -46,10 +46,25 @@ def test_fiedler_vector_tracemin_unknown():
)
def test_spectral_bisection():
pytest.importorskip("scipy")
G = nx.barbell_graph(3, 0)
C = nx.spectral_bisection(G)
assert C == ({0, 1, 2}, {3, 4, 5})
mapping = dict(enumerate("badfec"))
G = nx.relabel_nodes(G, mapping)
C = nx.spectral_bisection(G)
assert C == (
{mapping[0], mapping[1], mapping[2]},
{mapping[3], mapping[4], mapping[5]},
)
def check_eigenvector(A, l, x):
nx = np.linalg.norm(x)
# Check zeroness.
assert not nx == pytest.approx(0, abs=1e-7)
assert nx != pytest.approx(0, abs=1e-07)
y = A @ x
ny = np.linalg.norm(y)
# Check collinearity.