Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3 /
dist-packages /
networkx /
linalg /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
tests
[ DIR ]
drwxr-xr-x
__init__.py
538
B
-rw-r--r--
algebraicconnectivity.py
19.01
KB
-rw-r--r--
attrmatrix.py
15.41
KB
-rw-r--r--
bethehessianmatrix.py
2.63
KB
-rw-r--r--
graphmatrix.py
5.42
KB
-rw-r--r--
laplacianmatrix.py
11.13
KB
-rw-r--r--
modularitymatrix.py
5
KB
-rw-r--r--
spectrum.py
4.1
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : spectrum.py
""" Eigenvalue spectrum of graphs. """ # Copyright (C) 2004-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = "\n".join(['Aric Hagberg <aric.hagberg@gmail.com>', 'Pieter Swart (swart@lanl.gov)', 'Dan Schult(dschult@colgate.edu)', 'Jean-Gabriel Young (jean.gabriel.young@gmail.com)']) __all__ = ['laplacian_spectrum', 'adjacency_spectrum', 'modularity_spectrum', 'normalized_laplacian_spectrum', 'bethe_hessian_spectrum'] def laplacian_spectrum(G, weight='weight'): """Returns eigenvalues of the Laplacian of G Parameters ---------- G : graph A NetworkX graph weight : string or None, optional (default='weight') The edge data key used to compute each value in the matrix. If None, then each edge has weight 1. Returns ------- evals : NumPy array Eigenvalues Notes ----- For MultiGraph/MultiDiGraph, the edges weights are summed. See to_numpy_matrix for other options. See Also -------- laplacian_matrix """ from scipy.linalg import eigvalsh return eigvalsh(nx.laplacian_matrix(G, weight=weight).todense()) def normalized_laplacian_spectrum(G, weight='weight'): """Return eigenvalues of the normalized Laplacian of G Parameters ---------- G : graph A NetworkX graph weight : string or None, optional (default='weight') The edge data key used to compute each value in the matrix. If None, then each edge has weight 1. Returns ------- evals : NumPy array Eigenvalues Notes ----- For MultiGraph/MultiDiGraph, the edges weights are summed. See to_numpy_matrix for other options. See Also -------- normalized_laplacian_matrix """ from scipy.linalg import eigvalsh return eigvalsh(nx.normalized_laplacian_matrix(G, weight=weight).todense()) def adjacency_spectrum(G, weight='weight'): """Returns eigenvalues of the adjacency matrix of G. Parameters ---------- G : graph A NetworkX graph weight : string or None, optional (default='weight') The edge data key used to compute each value in the matrix. If None, then each edge has weight 1. Returns ------- evals : NumPy array Eigenvalues Notes ----- For MultiGraph/MultiDiGraph, the edges weights are summed. See to_numpy_matrix for other options. See Also -------- adjacency_matrix """ from scipy.linalg import eigvals return eigvals(nx.adjacency_matrix(G, weight=weight).todense()) def modularity_spectrum(G): """Returns eigenvalues of the modularity matrix of G. Parameters ---------- G : Graph A NetworkX Graph or DiGraph Returns ------- evals : NumPy array Eigenvalues See Also -------- modularity_matrix References ---------- .. [1] M. E. J. Newman, "Modularity and community structure in networks", Proc. Natl. Acad. Sci. USA, vol. 103, pp. 8577-8582, 2006. """ from scipy.linalg import eigvals if G.is_directed(): return eigvals(nx.directed_modularity_matrix(G)) else: return eigvals(nx.modularity_matrix(G)) def bethe_hessian_spectrum(G, r=None): """Returns eigenvalues of the Bethe Hessian matrix of G. Parameters ---------- G : Graph A NetworkX Graph or DiGraph r : float Regularizer parameter Returns ------- evals : NumPy array Eigenvalues See Also -------- bethe_hessian_matrix References ---------- .. [1] A. Saade, F. Krzakala and L. Zdeborová "Spectral clustering of graphs with the bethe hessian", Advances in Neural Information Processing Systems. 2014. """ from scipy.linalg import eigvalsh return eigvalsh(nx.bethe_hessian_matrix(G, r).todense()) # fixture for pytest def setup_module(module): import pytest scipy.linalg = pytest.importorskip('scipy.linalg')
Close