zombiepopla.blogg.se

Bridge cc 6.2
Bridge cc 6.2













If ``d`` is a dictionary ``d`` correspondings to the weight. The third item, ``d``, can be a dictionary or a real number. In the weighted case, each item is a 3-tuple ``(u, v, d)`` or a dict with items ``(u, v): d``. In the unweighted case, each item is an edge ``(u, v)``. Otherwise, each item is an available edge (with an optional weight). If unspecified, then all edges in the complement of G are available. k : integer Desired edge connectivity avail : dict or a set of 2 or 3 tuples The available edges that can be used in the augmentation. Parameters - G : NetworkX graph An undirected graph. Furthermore, a k-edge-augmentation may not exist. In general, finding a k-edge-augmentation is NP-hard, so solutions are not garuenteed to be minimal. This function uses the most efficient function available (depending on the value of k and if the problem is weighted or unweighted) to search for a minimum weight subset of available edges that k-edge-connects G. Adding edges from the augmentation to G make it impossible to disconnect G unless k or more edges are removed. ( "directed" ) ( "multigraph" ) def k_edge_augmentation ( G, k, avail = None, weight = None, partial = False ): """Finds set of edges to k-edge-connect G. See Also - :func:`is_k_edge_connected` Examples - > from import is_locally_k_edge_connected > G = nx.barbell_graph(10, 0) > is_locally_k_edge_connected(G, 5, 15, k=1) True > is_locally_k_edge_connected(G, 5, 15, k=2) False > is_locally_k_edge_connected(G, 1, 5, k=2) True """ if k = k s : node Source node t : node Target node k : integer local edge connectivity for nodes s and t Returns - boolean True if s and t are locally k-edge-connected in G. Is it impossible to disconnect s and t by removing fewer than k edges? If so, then s and t are locally k-edge-connected in G. ( "directed" ) ( "multigraph" ) def is_locally_k_edge_connected ( G, s, t, k ): """Tests to see if an edge in a graph is locally k-edge-connected. See Also - :func:`is_locally_k_edge_connected` Examples - > G = nx.barbell_graph(10, 0) > nx.is_k_edge_connected(G, k=1) True > nx.is_k_edge_connected(G, k=2) False """ if k = k k : integer edge connectivity to test for Returns - boolean True if G is k-edge-connected. Is it impossible to disconnect the graph by removing fewer than k edges? If so, then G is k-edge-connected. ( "directed" ) ( "multigraph" ) def is_k_edge_connected ( G, k ): """Tests to see if a graph is k-edge-connected.















Bridge cc 6.2