Skip to content

Commit

Permalink
fixed merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ebergamini committed Jun 23, 2016
1 parent 27ecb1f commit 05774b1
Showing 1 changed file with 6 additions and 54 deletions.
60 changes: 6 additions & 54 deletions networkit/_NetworKit.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2152,8 +2152,8 @@ cdef extern from "cpp/generators/HyperbolicGenerator.h":
_Graph generate(vector[double] angles, vector[double] radii, double R, double T) except +

cdef class HyperbolicGenerator:
""" The Hyperbolic Generator distributes points in hyperbolic space and adds edges between points if their hyperbolic distance is below a threshold. The resulting graphs have a power-law degree distribution, small diameter and high clustering coefficient.
Geometrically, the model resembles a unit-disk model in hyperbolic space. Time complexity is O((n^(3/2)+m)*log n).
""" The Hyperbolic Generator distributes points in hyperbolic space and adds edges between points with a probability depending on their distance. The resulting graphs have a power-law degree distribution, small diameter and high clustering coefficient.
For a temperature of 0, the model resembles a unit-disk model in hyperbolic space.
HyperbolicGenerator(n, k=6, gamma=3, T=0)
Expand All @@ -2178,46 +2178,19 @@ cdef class HyperbolicGenerator:
self._this = new _HyperbolicGenerator(n, k, gamma, T)

def setLeafCapacity(self, capacity):
"""
Tuning parameter to optimize performance. Default is 1024
Parameters
----------
capacity : integer
number of nodes that fit in a quadtree cell before it is split
"""
self._this.setLeafCapacity(capacity)

def setBalance(self, balance):
"""
Tuning parameter to optimize performance. Between 0 and 1.
Parameters
----------
balance : double
ratio of area going to outer nodes in radial split
"""
self._this.setBalance(balance)

def setTheoreticalSplit(self, theoreticalSplit):
self._this.setTheoreticalSplit(theoreticalSplit)

def getElapsedMilliseconds(self):
"""
Returns a list showing the time each thread spent generating the edge lists
Parameters
----------
None
Returns
-------
list[float]
"""
return self._this.getElapsedMilliseconds()

def generate(self):
""" Generates a hyperbolic unit disk graph
""" Generates hyperbolic random graph
Returns
-------
Expand All @@ -2226,30 +2199,9 @@ cdef class HyperbolicGenerator:
"""
return Graph(0).setThis(self._this.generate())

def generateExternal(self, angles, radii, k, gamma):
"""
Generates a graph given fixed point coordinates. Results are deterministic.
Parameters
----------
angles : list[float]
angular coordinates of input points
radii : list[float]
radial coordinates of input points
k : float
desired average degree
gamma : float
desired power-law exponent
The parameters k and gamma are only needed to calculate the disk radius R.
They should be the values used to generate the point coordinates.
If they are different, behaviour is undefined.
Returns
-------
Graph
"""
return Graph(0).setThis(self._this.generateExternal(angles, radii, k, gamma))
def generate(self, angles, radii, R, T=0):
# TODO: documentation
return Graph(0).setThis(self._this.generate(angles, radii, R, T))

@classmethod
def fit(cls, Graph G, scale=1):
Expand Down

0 comments on commit 05774b1

Please sign in to comment.