conductance#
- graph_tool.structure.conductance(g, S, T=None, weight=None)[git][source]#
Return the conductance of the cut between two sets of vertices.
- Parameters:
- g
Graph Graph to be used.
- Siterable of
intorVertexPropertyMap First set of vertices, as a sequence of vertices or a Boolean vertex property map.
- Titerable of
intorVertexPropertyMap(optional, default:None) Second set of vertices. If not given, the complement of
Sis used.- weight
EdgePropertyMap(optional, default:None) Edge weights. If not given, every edge has weight one.
- g
- Returns:
- phi
float The conductance.
- phi
See also
cut_sizeSize of the cut between two sets of vertices
normalized_cut_sizeCut size normalized by both volumes
edge_expansionCut size normalized by the size of the set
volumeTotal degree of a set of vertices
Notes
The conductance is \(c(S,T)/\min(\mathrm{vol}(S),\mathrm{vol}(T))\), where \(c(S,T)\) is the cut size (see
cut_size()) and \(\mathrm{vol}\) the volume (seevolume()). The time is \(O(V + E)\).Examples
>>> g = gt.collection.data["karate"] >>> S = np.arange(17) >>> print(gt.conductance(g, S)) 0.263157894736...