code: def getIncEdgesMap(self):
          
  
          # We calculate the number of incoming edges for each candidate and store it into a dictionary 
          # that associates the number of incoming edges with the candidates with that number.
          incEdgesMap = dict()
          for cand1 in self.wmgMap.keys():
              incEdgesSum = 0
              for cand2 in self.wmgMap[cand1].keys():
                  if self.wmgMap[cand1][cand2] > 0:
                      incEdgesSum += self.wmgMap[cand1][cand2]
              
              # Check if this is the first candidate associated with this number of associated edges.
              if incEdgesSum in incEdgesMap.keys():
                  incEdgesMap[incEdgesSum].append(cand1)
              else:
                  incEdgesMap[incEdgesSum] = [cand1]  
  
          return incEdgesMap
docs: Returns a dictionary that associates numbers of incoming edges in the weighted majority
          graph with the candidates that have that number of incoming edges.