# Source code for graphscope.analytical.app.clustering

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
#

from graphscope.framework.app import AppAssets
from graphscope.framework.app import not_compatible_for

__all__ = ["clustering"]

[docs]@not_compatible_for("arrow_property", "dynamic_property")
def clustering(graph):
"""Local clustering coefficient of a node in a Graph is the fraction
of pairs of the node’s neighbors that are adjacent to each
other.

Args:
graph (:class:Graph): A projected simple graph.

Returns:
:class:VertexDataContext: A context with each vertex assigned the computed clustering value.

Examples:

.. code:: python

import graphscope as gs
s = gs.session()