diff --git a/freeman.rst b/freeman.rst new file mode 100644 index 0000000..7c23c80 --- /dev/null +++ b/freeman.rst @@ -0,0 +1,30 @@ +Freeman's network centrality +===================== + +Freeman's centrality tells us how heterogenous is degree centrality ammong vertices of network. For start network, we will get a value 1. + +:math:`FC(g)=\frac{\sum_{x \in g}{N_{max}-|N(x)|}}{(|g|-1)*(|g|-2)}` + +Where ``g`` is given graph, ``N(x)`` returns set of neighbours of vertex ``x``, ``|g|`` is number of vertices in graph ``g`` and :math:`N_{max}` is maximal degree that can be observed in network. + +For further informations please refere to [Freeman]_. + +.. code-block:: scala + + import ml.sparkling.graph.operators.OperatorsDSL._ + import org.apache.spark.SparkContext + import org.apache.spark.graphx.Graph + + implicit ctx:SparkContext=??? + // initialize your SparkContext as implicit value + val graph =??? + // load your graph (for example using Graph loading API) + + val freemanCentrality: Double= graph.freemanCentrality() + // Freeman centrality value for graph + + + +References: + +.. [Freeman] Freeman, L. C. (1978). Centrality in social networks conceptual clarification. Social networks, 1(3), 215-239., `PDF `_ \ No newline at end of file diff --git a/measures.rst b/measures.rst index c094b21..19864df 100644 --- a/measures.rst +++ b/measures.rst @@ -7,7 +7,17 @@ Using SparklingGraph you can utilize multiple well-known measures for graphs. Graph measures API ------------------ -Each mesure extends `VertexMeasure `_ trait, defining what kind of value will be returned for each vertex. For main part of measures that will be a single number (like Double) but for some of them a tupple can be returned (like (Double,Double)). Each measure defines also implicit methods for graph, thanks to what your code will be more readable, and you will develop your experiments faster. + +Graph measures ++++++++++++++++++ + +Each graph mesure extends `GraphMeasure `_ trait, defining what kind of value will be returned for whole graph. + + +Vertex measures ++++++++++++++++++ + +Each vertex mesure extends `VertexMeasure `_ trait, defining what kind of value will be returned for each vertex. For main part of measures that will be a single number (like Double) but for some of them a tupple can be returned (like (Double,Double)). Each measure defines also implicit methods for graph, thanks to what your code will be more readable, and you will develop your experiments faster. Measures accepts `VertexMeasureConfiguration `_ in order to configure computation process. You can set following parameters: @@ -21,13 +31,24 @@ Measures Curretnly you can use following measures: -.. toctree:: - :maxdepth: 2 - - closeness - eigenvector - hits - degree - neighborhoodConnectivity - vertexEmbeddedness - localClustering \ No newline at end of file + +* Vertex measures: + + .. toctree:: + :maxdepth: 2 + + closeness + eigenvector + hits + degree + neighborhoodConnectivity + vertexEmbeddedness + localClustering + + +* Graph measures: + + .. toctree:: + :maxdepth: 2 + + freeman