graph - Python: Find the total weights of a subgraph's outside edges -


i'm using python-igraph extract subgraph non-directed graph. nodes locations, , subgraph represents nodes/edges within radius node.

i need find weights connect outside nodes of subgraph main graph, there simple way of doing this? i'm not sure of formally called.

this total weight of cut between chosen set of nodes , rest of graph. can try this:

your_nodes = [1, 2, 3] other_nodes = sorted(set(range(graph.vcount())) - set(your_nodes)) weight_of_cut = sum(graph.es.select(_between=(your_nodes, other_nodes))["weight"]) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -