rm CondaPkg environment
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user