Esempio n. 1
0
def graRep(population, neighbors, probability):
    g = nx.newman_watts_strogatz_graph(population, neighbors, probability)
    model = GraRep()
    model.fit(g)
    embedding = model.get_embedding()

    #print(embedding)
    return [embedding]
Esempio n. 2
0
# Label Propagation example
#----------------------------

g = nx.newman_watts_strogatz_graph(100, 10, 0.02)

model = LabelPropagation()

model.fit(g)

#-----------------
# GraRep example
#-----------------

g = nx.newman_watts_strogatz_graph(100, 10, 0.02)

model = GraRep()

model.fit(g)

embedding = model.get_embedding()

#-------------------
# GraphWave example
#-------------------

g = nx.newman_watts_strogatz_graph(100, 10, 0.02)

model = GraphWave()

model.fit(g)
Esempio n. 3
0
"""GraRep illustrative example."""

import networkx as nx
from karateclub.node_embedding.neighbourhood import GraRep

g = nx.newman_watts_strogatz_graph(100, 20, 0.05)

model = GraRep()

model.fit(g)