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

@@ -8,7 +8,7 @@ structure, dynamics, and functions of complex networks.
See https://networkx.org for complete documentation.
"""
__version__ = "3.0"
__version__ = "3.1"
# These are imported in order as listed

View File

@@ -1,12 +1,12 @@
"""Approximations of graph properties and Heuristic methods for optimization.
.. warning:: These functions are not imported in the top-level of ``networkx``
The functions in this class are not imported into the top-level ``networkx``
namespace so the easiest way to use them is with::
These functions can be accessed using
``networkx.approximation.function_name``
>>> from networkx.algorithms import approximation
They can be imported using ``from networkx.algorithms import approximation``
or ``from networkx.algorithms.approximation import function_name``
Another option is to import the specific function with
``from networkx.algorithms.approximation import function_name``.
"""
from networkx.algorithms.approximation.clustering_coefficient import *

View File

@@ -387,7 +387,7 @@ def _bidirectional_pred_succ(G, source, target, exclude):
# thus source and target will only trigger "found path" when they are
# adjacent and then they can be safely included in the container 'exclude'
level += 1
if not level % 2 == 0:
if level % 2 != 0:
this_level = forward_fringe
forward_fringe = []
for v in this_level:

View File

@@ -212,7 +212,7 @@ class _AntiGraph(nx.Graph):
def single_edge_dict(self):
return self.all_edge_dict
edge_attr_dict_factory = single_edge_dict # type: ignore
edge_attr_dict_factory = single_edge_dict # type: ignore[assignment]
def __getitem__(self, n):
"""Returns a dict of neighbors of node n in the dense graph.

View File

@@ -134,21 +134,21 @@ def steiner_tree(G, terminal_nodes, weight="weight", method=None):
The approximation algorithm is specified with the `method` keyword
argument. All three available algorithms produce a tree whose weight is
within a (2 - (2 / l)) factor of the weight of the optimal Steiner tree,
where *l* is the minimum number of leaf nodes across all possible Steiner
within a ``(2 - (2 / l))`` factor of the weight of the optimal Steiner tree,
where ``l`` is the minimum number of leaf nodes across all possible Steiner
trees.
* `kou` [2]_ (runtime $O(|S| |V|^2)$) computes the minimum spanning tree of
the subgraph of the metric closure of *G* induced by the terminal nodes,
where the metric closure of *G* is the complete graph in which each edge is
weighted by the shortest path distance between the nodes in *G*.
* ``"kou"`` [2]_ (runtime $O(|S| |V|^2)$) computes the minimum spanning tree of
the subgraph of the metric closure of *G* induced by the terminal nodes,
where the metric closure of *G* is the complete graph in which each edge is
weighted by the shortest path distance between the nodes in *G*.
* `mehlhorn` [3]_ (runtime $O(|E|+|V|\log|V|)$) modifies Kou et al.'s
algorithm, beginning by finding the closest terminal node for each
non-terminal. This data is used to create a complete graph containing only
the terminal nodes, in which edge is weighted with the shortest path
distance between them. The algorithm then proceeds in the same way as Kou
et al..
* ``"mehlhorn"`` [3]_ (runtime $O(|E|+|V|\log|V|)$) modifies Kou et al.'s
algorithm, beginning by finding the closest terminal node for each
non-terminal. This data is used to create a complete graph containing only
the terminal nodes, in which edge is weighted with the shortest path
distance between them. The algorithm then proceeds in the same way as Kou
et al..
Parameters
----------

View File

@@ -36,7 +36,7 @@ def test_random_partitioning_all_to_one():
def test_one_exchange_basic():
G = nx.complete_graph(5)
random.seed(5)
for (u, v, w) in G.edges(data=True):
for u, v, w in G.edges(data=True):
w["weight"] = random.randrange(-100, 100, 1) / 10
initial_cut = set(random.sample(sorted(G.nodes()), k=5))
@@ -68,7 +68,7 @@ def test_one_exchange_optimal():
def test_negative_weights():
G = nx.complete_graph(5)
random.seed(5)
for (u, v, w) in G.edges(data=True):
for u, v, w in G.edges(data=True):
w["weight"] = -1 * random.random()
initial_cut = set(random.sample(sorted(G.nodes()), k=5))

View File

@@ -12,7 +12,7 @@ pairwise = nx.utils.pairwise
def test_christofides_hamiltonian():
random.seed(42)
G = nx.complete_graph(20)
for (u, v) in G.edges():
for u, v in G.edges():
G[u][v]["weight"] = random.randint(0, 10)
H = nx.Graph()

View File

@@ -22,7 +22,7 @@ def is_tree_decomp(graph, decomp):
assert appear_once
# Check if each connected pair of nodes are at least once together in a bag
for (x, y) in graph.edges():
for x, y in graph.edges():
appear_together = False
for bag in decomp.nodes():
if x in bag and y in bag:

View File

@@ -530,7 +530,7 @@ def held_karp_ascent(G, weight="weight"):
pp.1138-1162
"""
import numpy as np
import scipy.optimize as optimize
from scipy import optimize
def k_pi():
"""
@@ -785,7 +785,7 @@ def held_karp_ascent(G, weight="weight"):
# reference [1]
z_star = {}
scale_factor = (G.order() - 1) / G.order()
for u, v in x_star.keys():
for u, v in x_star:
frequency = x_star[(u, v)] + x_star[(v, u)]
if frequency > 0:
z_star[(u, v)] = scale_factor * frequency

Some files were not shown because too many files have changed in this diff Show More