Commit 2db745b1 authored by Tiago Peixoto's avatar Tiago Peixoto

Several documentation fixes and extensions

This completes all the documentation up to this point.
parent bb499c3b
......@@ -14,3 +14,8 @@
{{ super() }}
{% endblock %}
{% block sidebarsearch %}
{{ super() }}
<a href="graph-tool.pdf">(Download PDF version)</a>
{% endblock %}
......@@ -26,7 +26,7 @@ sys.path.append(os.path.abspath('.'))
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
'sphinx.ext.intersphinx', 'sphinx.ext.jsmath',
'sphinxext.numpydoc']
'sphinxext.numpydoc', 'sphinxext.autosummary']
jsmath_path = "jsMath/easy/load.js"
......@@ -94,6 +94,38 @@ pygments_style = 'sphinx'
doctest_global_setup = \
r"""
from matplotlib import rc
from matplotlib import rcParams
font_size=12
rcParams["figure.figsize"] = (4,3)
rcParams["font.family"] = "serif"
rcParams["font.serif"] = ["Palatino"]
rcParams["font.size"] = font_size
rcParams["axes.labelsize"] = font_size
rcParams["xtick.labelsize"] = font_size
rcParams["ytick.labelsize"] = font_size
rcParams["legend.numpoints"] = 1
rcParams["legend.fontsize"] = "small"
rcParams["lines.markersize"] = 4
rcParams["figure.subplot.right"] = 0.95
rcParams["figure.subplot.top"] = 0.95
rcParams["figure.subplot.right"] = 0.95
rcParams["figure.subplot.top"] = 0.95
rcParams["figure.subplot.left"] = 0.2
rcParams["figure.subplot.bottom"] = 0.2
rcParams["text.usetex"] = True
rcParams["ps.usedistiller"] = "xpdf"
rcParams["pdf.compression"] = 9
rcParams["ps.useafm"] = True
rcParams["path.simplify"] = True
rcParams["text.latex.preamble"] = [#"\usepackage{times}",
"\usepackage{euler}",
"\usepackage{amssymb}",
"\usepackage{amsmath}"]
from numpy import array
import scipy
import scipy.stats
......@@ -107,7 +139,10 @@ import graph_tool.all as gt
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_style = 'default.css'
# html_style = 'default.css'
html_theme = "gt_theme"
html_theme_path = ["."]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
......@@ -132,11 +167,11 @@ html_static_path = ['.static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
......@@ -172,35 +207,20 @@ htmlhelp_basename = 'graph-tooldoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples (source start
# file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', 'graph-tool.tex', ur'graph-tool Documentation',
('index', 'graph-tool.tex', ur'graph-tool documentation',
ur'Tiago de Paula Peixoto', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
#latex_logo = "graph-draw.png"
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
latex_elements = {
'papersize' : "a4paper",
'fontpkg' : r"\usepackage{palatino}\usepackage{eulervm}"
}
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
# Example configuration for intersphinx: refer to the Python standard library.
......
......@@ -5,6 +5,7 @@ Available subpackages
=====================
.. toctree::
:maxdepth: 1
centrality
clustering
......
@import url("default.css");
table.docutils td {
padding-left: 0.5em;
}
/* stupid workaround to hide ugly c++ signature stuff from sphinx*/
dl.method dl.last {
visibility: collapse;
height: 0px;
width: 0px;
}
div.align-center {
text-align: center;
}
div.float-left {
float: left;
}
div.float-right {
float: right;
}
p.rubric {
clear: both;
}
\ No newline at end of file
[theme]
inherit = default
stylesheet = gt_style.css
......@@ -8,12 +8,13 @@ Welcome to graph-tool's documentation!
Contents:
.. toctree::
:maxdepth: 3
:glob:
quickstart
modules
Indices and tables
Indexes and tables
==================
* :ref:`genindex`
......
......@@ -56,11 +56,13 @@ for i in xrange(1, N):
in_hist = vertex_hist(g, "in")
clf()
figure(figsize=(4,3))
errorbar(in_hist[1], in_hist[0], fmt="o", yerr=sqrt(in_hist[0]), label="in")
gca().set_yscale("log")
gca().set_xscale("log")
legend(loc="best")
gca().set_ylim(1e-1,1e5)
gca().set_xlim(0.8,1e3)
subplots_adjust(left=0.2,bottom=0.2)
xlabel("$k_{in}$")
ylabel("$P(k_{in})$")
savefig("deg-hist.png")
......
......@@ -191,9 +191,9 @@ and :meth:`~graph_tool.Vertex.in_neighbours` respectively.
Property maps
-------------
Property maps are a way of associating additional to the vertices, edges or to
the graph itself. There are thus three types of property maps: vertex, edge and
graph. All of them are instances of the same class,
Property maps are a way of associating additional information to the vertices,
edges or to the graph itself. There are thus three types of property maps:
vertex, edge and graph. All of them are instances of the same class,
:class:`~graph_tool.PropertyMap`. Each property map has an associated *value
type*, which must be chosen from the predefined set:
......@@ -310,9 +310,18 @@ Graph classes can also be pickled with the :mod:`pickle` module.
An Example: Building a Price Network
------------------------------------
A Price network is the first known model of a "scale-free" graph, invented in
1976 by `de Solla Price
<http://en.wikipedia.org/wiki/Derek_J._de_Solla_Price>`_. It is defined
dynamically, and at each time step a new vertex is added to the graph, and
connected to an old vertex, with probability proportional to its in-degree. The
following program implements this construction method using ``graph-tool``.
.. literalinclude:: price.py
:linenos:
The following is what should happen when the program is run.
.. testcode::
:hide:
......@@ -333,6 +342,9 @@ An Example: Building a Price Network
vertex: 0 in-degree: 210 out-degree: 0 age: 0
Nowhere else to go... We found the main hub!
This is the degree distribution, with 100000 nodes. If you want to really see a
power law, try to increase the number of vertices to something like :math:`10^6`
or :math:`10^7`.
.. figure:: deg-hist.png
:align: center
......@@ -346,9 +358,130 @@ use the :func:`~graph_tool.draw.graph_draw` function.
g = load_graph("price.xml.gz")
g.remove_vertex_if(lambda v: g.vertex_index[v] >= 1000)
gt.graph_draw(g, output="price.png")
graph_draw(g, size=(10,10), layout="arf", output="price.png")
.. figure:: price.png
:align: center
First 1000 nodes of a price network.
Graph filtering
---------------
One of the very nice features from ``graph-tool`` is the "on-the-fly" filtering
of edges and/or vertices. Filtering means the temporary masking of
vertices/edges, which are not really removed, and can be easily
recovered. Vertices or edges which are to be filtered should be marked with a
:class:`~graph_tool.PropertyMap` with value type ``bool``, and then set with
:meth:`~graph_tool.Graph.set_vertex_filter` or
:meth:`~graph_tool.Graph.set_edge_filter` methods. By default, vertex or edges
with value "1" are `kept` in the graphs, and those with value "0" are filtered
out. This behaviour can be modified with the ``inverted`` parameter of the
respective functions. All manipulation functions and algorithms will work as if
the marked edges or vertices were removed from the graph, with minimum overhead.
Here is an example which obtains the minimum spanning tree of a graph, using
edge filtering.
.. testcode::
:hide:
seed(42)
.. testcode::
g = random_graph(100, lambda: (poisson(4), poisson(4)))
tree = min_spanning_tree(g)
graph_draw(g, size=(8,8), ecolor=tree, output="min_tree.png")
The ``tree`` property map has a bool type, with value "1" if the edge belongs to
the tree, and "0" otherwise. Below is an image of the original graph, with the
marked edges.
.. figure:: min_tree.png
:align: center
We can now filter out the edges which don't belong to the minimum spanning tree.
.. testcode::
g.set_edge_filter(tree)
graph_draw(g, size=(8,8), layout="arf", output="min_tree_filtered.png")
This is how the graph looks when filtered:
.. figure:: min_tree_filtered.png
:align: center
Everything should work transparently on the filtered graph, simply as if the
masked edges were removed.
.. testcode::
pr = pagerank(g)
print pr.a
Which outputs the following.
.. testoutput::
[ 1.21896533 0.2 0.28 0.36 0.28 0.2 0.2
0.2 0.2 0.44 0.2 0.53813333 0.344 0.2
0.52 0.4752 0.53066667 0.2 0.85066667 0.2
0.37813333 0.28 2.65013333 0.78133333 0.2 0.2 0.28
0.2 0.2 0.2 0.2 0.2 0.2 0.2
0.2 0.41333333 0.2 0.2 0.25333333 0.2
0.41333333 0.2 0.76 0.2 0.2 1.27370667
0.36 0.2 0.2 0.28 0.36 0.6 0.2
1.17517227 0.40266667 0.2 0.44533333 1.016 0.424 0.28
0.2 0.2 0.44 0.6 0.2 0.2 0.44
0.2 0.2 0.28 0.25333333 0.25333333 0.28 0.2
1.24213333 0.2 0.40266667 0.28 0.36 0.2 0.2
0.2 0.2 0.54133333 0.2 0.5552 0.2 0.44
0.44 0.2 0.2 0.28 0.2 0.6 0.2
0.44 0.2 0.28 0.344 0.472 ]
The original graph can be recovered by setting the edge filter to ``None``.
.. testcode::
g.set_edge_filter(None)
pr = pagerank(g)
print pr.a
Which outputs the following.
.. testoutput::
[ 0.39689941 0.2 1.38764556 0.31699172 0.66893137 0.80523725
0.67802789 0.40784401 0.29361908 1.22559931 0.750107 1.02862225
0.6472381 0.78447305 0.54791497 0.73210888 1.00329801 0.43209786
1.20758525 0.95797897 0.97106576 0.38080744 2.35690886 1.35609636
1.04694293 0.47676748 0.870367 0.9034519 0.60360189 0.24
0.35010316 0.81055356 0.59406634 0.68903488 0.3701726 0.50917786
0.819167 0.31490118 0.67404843 0.74766878 1.25501188 0.2
1.97251855 0.77583825 0.62509331 0.55088128 0.41242224 0.70903083
0.5918624 0.92565929 2.1083913 0.99864279 0.47676748 0.30583984
0.45919658 0.3551633 2.58583616 1.07020892 0.44358295 0.75860401
0.51277849 0.54073371 0.79816833 1.52121868 0.93996758 0.25077432
0.48392002 0.7181324 0.4789649 1.88431987 0.42763893 0.82713964
1.0133979 0.8693855 1.94140631 0.39321364 1.27413606 3.16059924
1.32889816 0.89569002 0.27990067 0.64233367 0.89888256 1.24365097
0.56000105 1.1805301 0.76991724 1.3304796 1.04003837 1.50556425
0.39110528 0.2762828 0.2 1.57628517 1.38463963 1.03787805
0.81171454 0.95811153 0.5728202 1.26472067]
Everything works in analogous fashion with vertex filtering.
.. note::
It is important to emphasize that the filtering functionality does not add
any overhead when the graph is not being filtered. In this case, the
algorithms run just as fast as if the filtering functionality didn't exist.
Additionally, the graph can also have its edges reversed with the
:meth:`~graph_tool.Graph.set_reversed` method. This is also an :math:`O(1)`
operation, which does not really modify the graph.
As mentioned previously, the directedness of the graph can also be changed
"on-the-fly" with the :meth:`~graph_tool.Graph.set_directed` method.
\ No newline at end of file
......@@ -189,8 +189,8 @@ def get_autosummary(names, state, no_signatures=False):
table = nodes.table('')
group = nodes.tgroup('', cols=2)
table.append(group)
group.append(nodes.colspec('', colwidth=30))
group.append(nodes.colspec('', colwidth=70))
group.append(nodes.colspec('', colwidth=45))
group.append(nodes.colspec('', colwidth=55))
body = nodes.tbody('')
group.append(body)
......
......@@ -49,35 +49,22 @@ Use the built-in ``help`` function to view a function's docstring::
>>> help(gt.Graph)
Available subpackages
---------------------
clustering
clustering (aka. transitivity)
community
community detection
correlations
vertex and edge correlations
draw
Graph drawing using graphviz
generation
random graph generation
misc
miscenalenous algorithms
stats
vertex and edge statistics
util
assorted utilities
Utilities
---------
show_config
Show ``graph_tool`` build configuration
__version__
``graph_tool`` version string
Classes
-------
.. autosummary::
:nosignatures:
Graph
Vertex
Edge
PropertyMap
load_graph
group_vector_property
ungroup_vector_property
value_types
show_config
"""
__author__="Tiago de Paula Peixoto <tiago@forked.de>"
......
......@@ -21,6 +21,21 @@
-----------------------------------------------
This module includes centrality-related algorithms.
Summary
+++++++
.. autosummary::
:nosignatures:
pagerank
betweenness
central_point_dominance
eigentrust
absolute_trust
Contents
++++++++
"""
from .. dl_import import dl_import
......@@ -39,11 +54,11 @@ def pagerank(g, damping=0.8, prop=None, epslon=1e-6, max_iter=None,
Parameters
----------
g : Graph
g : :class:`~graph_tool.Graph`
Graph to be used.
damping : float, optional (default: 0.8)
Damping factor.
prop : ProperyMap, optional (default: None)
prop : :class:`~graph_tool.PropertyMap`, optional (default: None)
Vertex property map to store the PageRank values.
epslon : float, optional (default: 1e-6)
Convergence condition. The iteration will stop if the total delta of all
......@@ -55,7 +70,8 @@ def pagerank(g, damping=0.8, prop=None, epslon=1e-6, max_iter=None,
Returns
-------
pagerank : A vertex property map containing the PageRank values.
pagerank : :class:`~graph_tool.PropertyMap`
A vertex property map containing the PageRank values.
See Also
--------
......@@ -65,7 +81,7 @@ def pagerank(g, damping=0.8, prop=None, epslon=1e-6, max_iter=None,
Notes
-----
The value of PageRank [pagerank_wikipedia]_ of vertex v :math:`PR(v)` is
The value of PageRank [pagerank-wikipedia]_ of vertex v :math:`PR(v)` is
given interactively by the relation:
.. math::
......@@ -86,31 +102,31 @@ def pagerank(g, damping=0.8, prop=None, epslon=1e-6, max_iter=None,
--------
>>> from numpy.random import poisson, seed
>>> seed(42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)), seed=42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> pr = gt.pagerank(g)
>>> print pr.get_array()
[ 1.01514315 0.60117439 0.32514372 0.28 0.2 1.54971179
0.28 1.0236911 0.33123536 0.4778296 0.62078363 1.25377064
0.49213262 1.70011842 0.30671734 0.56424761 0.86810689 1.68765055
0.49551575 0.72837655 0.39240949 1.43802363 0.51563806 0.41983927
0.37857787 0.45875573 0.97033399 0.38531927 0.54001665 0.89328562
0.52122532 0.94064256 1.39911631 0.64663655 1.23521006 0.71722741
0.59460778 0.2 0.63239854 1.86292923 0.2 0.31277737
0.74650027 0.32415672 0.47975325 1.11611173 0.53433883 0.63352435
0.23822967 0.93151021 0.5440643 0.69188579 0.97489471 0.51216733
1.31721331 1.32808547 0.39894203 0.50384137 0.75225633 0.28220146
1.10818407 0.58685184 1.26437262 0.67929902 0.69678112 1.34428502
0.61651094 0.43008378 0.7905129 1.35318411 0.2 0.2
1.6584374 0.98009079 0.27200222 0.3413639 0.23822967 0.27963213
1.22498499 0.34097559 0.50749002 1.21145838 0.50430676 0.50218939
0.74232491 0.5335867 0.27254191 0.36031317 0.65344358 0.96712961
0.53252883 0.86479464 0.59958851 0.82703737 0.68722079 0.52036384
0.65299724 0.42291513 0.81729152 1.7586996 ]
[ 0.99988081 0.39997616 0.80428057 0.43237369 0.2 0.75830329
0.41447482 1.56621542 0.30841665 0.86432715 0.79374139 0.54573086
0.89372179 0.93590145 0.25159724 1.12033843 0.2 0.98486039
0.28191404 0.88133806 0.31166878 1.73878838 0.6903469 0.94100349
0.25159724 0.32248278 1.03788472 0.58022932 0.35009064 0.94542317
0.85751934 0.69608227 1.11373543 1.13477707 0.2 0.71559888
0.30461189 0.2 1.02871995 1.14657561 0.2 0.25031945
0.51841423 0.44709022 0.75239816 0.76551737 0.25638281 1.51657252
0.30841665 0.59707408 0.34179258 1.0590272 2.16427996 0.51196274
1.2264604 1.71578696 0.85838961 0.41931136 0.96797602 0.61882367
1.07826603 0.2984934 1.1305187 0.75006564 0.48066231 1.61759314
0.73870051 1.08374044 0.38258693 0.98112013 0.2 0.25590818
1.17500568 1.2288973 0.29613246 1.45937444 0.39997616 1.18311783
0.67063807 0.39229458 0.72314004 0.88473325 0.32859279 0.40656244
0.51754349 0.5315028 0.55196274 0.2335463 1.56357203 0.91464458
0.46999727 1.06779933 0.4852867 0.48933035 0.58997931 0.52883683
0.79385874 0.59244805 0.99896399 1.0470592 ]
References
----------
.. [pagerank_wikipedia] http://en.wikipedia.org/wiki/Pagerank
.. [lawrence_pagerank_1998] P. Lawrence, B. Sergey, M. Rajeev, W. Terry,
.. [pagerank-wikipedia] http://en.wikipedia.org/wiki/Pagerank
.. [lawrence-pagerank-1998] P. Lawrence, B. Sergey, M. Rajeev, W. Terry,
"The pagerank citation ranking: Bringing order to the web", Technical
report, Stanford University, 1998
"""
......@@ -133,13 +149,13 @@ def betweenness(g, vprop=None, eprop=None, weight=None, norm=True):
Parameters
----------
g : Graph
g : :class:`~graph_tool.Graph`
Graph to be used.
vprop : ProperyMap, optional (default: None)
vprop : :class:`~graph_tool.PropertyMap`, optional (default: None)
Vertex property map to store the vertex betweenness values.
eprop : ProperyMap, optional (default: None)
eprop : :class:`~graph_tool.PropertyMap`, optional (default: None)
Edge property map to store the edge betweenness values.
weight : ProperyMap, optional (default: None)
weight : :class:`~graph_tool.PropertyMap`, optional (default: None)
Edge property map corresponding to the weight value of each edge.
norm : bool, optional (default: True)
Whether or not the betweenness values should be normalized.
......@@ -173,7 +189,7 @@ def betweenness(g, vprop=None, eprop=None, weight=None, norm=True):
through the number of pairs of vertices not including v, which is
:math:`(n-1)(n-2)/2`.
The algorithm used here is defined in [brandes_faster_2001]_, and has a
The algorithm used here is defined in [brandes-faster-2001]_, and has a
complexity of :math:`O(VE)` for unweighted graphs and :math:`O(VE + V(V+E)
\log V)` for weighted graphs. The space complexity is :math:`O(VE)`.
......@@ -183,31 +199,31 @@ def betweenness(g, vprop=None, eprop=None, weight=None, norm=True):
--------
>>> from numpy.random import poisson, seed
>>> seed(42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)), seed=42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> vb, eb = gt.betweenness(g)
>>> print vb.get_array()
[ 0.03536033 0.03251351 0.00813873 0.00496977 0. 0.08339989
0.00948258 0.05751528 0.00236377 0.00868464 0.04443961 0.04691023
0.01768388 0. 0.01130552 0.01277964 0.04223144 0.05040177
0.01202611 0.0012722 0.00828095 0.11598601 0.01864867 0.01412404
0.03343004 0.01772387 0.04780278 0.01351748 0.03616999 0.09074218
0. 0. 0.03901368 0.02526396 0.07471888 0.00219886
0. 0. 0.01062083 0.07973799 0. 0.01410051
0.02025676 0. 0.00988767 0.07519014 0. 0.06380861
0. 0.01954769 0.04576145 0.04151243 0. 0.04198926
0.0462918 0.07353227 0.00606605 0.02597097 0.02566416 0.00196642
0.06240786 0.02996611 0.03252566 0.01451141 0.05149852 0.
0.03582571 0.04600123 0.03776439 0.03326425 0. 0.
0.11568858 0.01361223 0.00515358 0.007151 0.00241302 0.00271168
0.01780978 0.01867583 0.02020758 0.01254292 0.00054971 0.00698211
0.02359226 0.0385241 0.00157871 0.00576513 0.04173662 0.03233332
0.0208791 0.02286212 0.04366053 0.03701801 0.02142117 0.03099565
0.02555676 0.03365458 0.03542124 0.06174975]
[ 0.06129648 0.02004734 0.04305659 0.01071136 0. 0.0252028
0.00679622 0.06981881 0.00541371 0.02462107 0.05328111 0.0107051
0.05981227 0. 0.01315561 0.00131498 0. 0.01883264
0.01663386 0.03195175 0.01942617 0.13693745 0.01378875 0.00962001
0.01325009 0.04685362 0.03839758 0.03395201 0.02160984 0.01727593
0.0478231 0. 0.03826993 0.05124999 0. 0.
0.00705917 0. 0.02190356 0.04505211 0. 0.00676419
0.00110802 0.00169839 0.08733666 0.10546473 0. 0.12058932
0. 0.00907921 0.02182859 0.08865455 0. 0.0418017
0.03500162 0.07492683 0.03856307 0.04300598 0.02173347 0.00488363
0.03739852 0.01113193 0.04386369 0.02994719 0.03383728 0.
0.09230395 0.05449223 0.02507715 0.04944675 0. 0.00215935
0.04371057 0.01749238 0.00104315 0.04688928 0.00444627 0.0178016
0.01358585 0.02193068 0.03184527 0.05640358 0.00214389 0.03922583
0.02195544 0.02613584 0.02246488 0.00066481 0.0755375 0.03142692
0.04533332 0.03188087 0.04227853 0.03926328 0.00810412 0.02888085
0.0455241 0.01373183 0.07029039 0.04382892]
References
----------
.. [betweenness_wikipedia] http://en.wikipedia.org/wiki/Centrality#Betweenness_centrality
.. [brandes_faster_2001] U. Brandes, "A faster algorithm for betweenness
.. [betweenness-wikipedia] http://en.wikipedia.org/wiki/Centrality#Betweenness_centrality
.. [brandes-faster-2001] U. Brandes, "A faster algorithm for betweenness
centrality", Journal of Mathematical Sociology, 2001
"""
if vprop == None:
......@@ -230,9 +246,9 @@ def central_point_dominance(g, betweenness):
Parameters
----------
g : Graph
g : :class:`~graph_tool.Graph`
Graph to be used.
betweenness : ProperyMap
betweenness : :class:`~graph_tool.PropertyMap`
Vertex property map with the betweenness centrality values. The values
must be normalized.
......@@ -248,7 +264,7 @@ def central_point_dominance(g, betweenness):
Notes
-----
Let :math:`v^*` be the vertex with the largest relative betweenness
centrality; then, the central point dominance [freeman_set_1977]_ is defined
centrality; then, the central point dominance [freeman-set-1977]_ is defined
as:
.. math::
......@@ -264,14 +280,14 @@ def central_point_dominance(g, betweenness):
--------
>>> from numpy.random import poisson, seed
>>> seed(42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)), seed=42)
>>> g = gt.random_graph(100, lambda: (poisson(3), poisson(3)))
>>> vb, eb = gt.betweenness(g)
>>> print gt.central_point_dominance(g, vb)
0.0902382147799
0.108411171667
References
----------
.. [freeman_set_1977] Linton C. Freeman, "A Set of Measures of Centrality
.. [freeman-set-1977] Linton C. Freeman, "A Set of Measures of Centrality
Based on Betweenness", Sociometry, Vol. 40, No. 1, pp. 35-41 (1977)
"""
......@@ -287,9 +303,9 @@ def eigentrust(g, trust_map, vprop=None, norm=False, epslon=1e-6, max_iter=0,
Parameters
----------
g : Graphs
g : :class:`~graph_tool.Graph`
Graph to be used.