Example #1
0
 def _new_partitioner(self, algorithm, segments, bp_left, bp_right, options):
     '''A functor for partitioning a graph.'''
     if algorithm == 'naive': 
         p = NaivePartitioner(segments, bp_left, bp_right, options.min_degree, (options.debug >= 2))
         return p.partition
     elif algorithm == 'cast':
         return partition_cast.partition
     elif algorithm == 'amg':
         return lambda G: partition_amg.partition(G, theta=options.threshold)
     else:
         raise ValueError('Unsupported clique partitioning algorithm ''%s''' % (algorithm,)) 
 def _new_partitioner(self, options):
     '''A functor for partitioning a graph.'''
     algorithm = options.algorithm
     if algorithm == 'cast': return partition_cast.partition
     elif algorithm == 'amg':
         return lambda G: partition_amg.partition(G,
                                                  theta=options.threshold)
     else:
         raise ValueError('Unsupported clique partitioning algorithm '
                          '%s'
                          '' % (algorithm, ))
Example #3
0
 def _new_partitioner(self, algorithm, segments, bp_left, bp_right,
                      options):
     '''A functor for partitioning a graph.'''
     if algorithm == 'naive':
         p = NaivePartitioner(segments, bp_left, bp_right,
                              options.min_degree, (options.debug >= 2))
         return p.partition
     elif algorithm == 'cast':
         return partition_cast.partition
     elif algorithm == 'amg':
         return lambda G: partition_amg.partition(G,
                                                  theta=options.threshold)
     else:
         raise ValueError('Unsupported clique partitioning algorithm '
                          '%s'
                          '' % (algorithm, ))
 def _new_partitioner(self, options):
     '''A functor for partitioning a graph.'''
     algorithm = options.algorithm
     if algorithm == 'cast': return partition_cast.partition
     elif algorithm == 'amg': return lambda G: partition_amg.partition(G, theta=options.threshold)
     else: raise ValueError('Unsupported clique partitioning algorithm ''%s''' % (algorithm,))