Ignore:
Location:
Orange
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/orngCanvas.pyw

    r10838 r10903  
    55# This module has to be imported first because it takes care of the system PATH variable 
    66# Namely, it throws out the MikTeX directories which contain an incompatible Qt .dll's 
     7import Orange 
    78import orngEnviron, Orange.utils.addons 
    89 
  • Orange/network/community.py

    r10872 r10904  
    145145 
    146146def label_propagation(G, results2items=0, \ 
    147                       resultHistory2items=0, iterations=1000): 
     147                      resultHistory2items=0, iterations=1000, seed=None): 
    148148    """Label propagation for community detection, Raghavan et al., 2007 
    149149 
     
    163163 
    164164    """ 
     165 
     166    if seed is not None: 
     167        random.seed(seed) 
     168 
     169    vertices = sorted(G.nodes_iter()) 
     170    labels = dict(zip(vertices, range(G.number_of_nodes()))) 
    165171 
    166172    def next_label(neighbors): 
     
    174180        return [l for c, l in lbls if c >= m] 
    175181 
    176     vertices = G.nodes() 
    177     labels = dict(zip(vertices, range(G.number_of_nodes()))) 
    178182    lblhistory = [] 
    179183    for i in range(iterations): 
Note: See TracChangeset for help on using the changeset viewer.