# weightedConnectedComponents -- Counting the weighted number of connected components of a graph

## Synopsis

• Usage:
weightedConnectedComponents(G)
• Inputs:
• G, a Graph or a List
• Optional inputs:
• WeightMethod (missing documentation) => ..., default value PBEI,
• Outputs:
• the (weighted) number of connected components of G

## Description

This computes the (weighted) number of connected components of a graph. The weights are all one if WeightMethod='BEI' is chosen and if WeightMethod='PBEI', then bipartite components count twice.
 i1 : G={{1,2},{2,3},{3,1},{4,5},{6,7},{7,8},{6,8}}; i2 : weightedConnectedComponents(G,WeightMethod=>"BEI") o2 = 3 i3 : weightedConnectedComponents(G,WeightMethod=>"PBEI") o3 = 4