社区算法

class graphdatascience.procedure_surface.api.community.CliqueCountingEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult

估算运行团计数算法的内存需求。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

返回:

内存估算结果

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) CliqueCountingMutateResult

执行团计数算法,并将结果作为节点属性写入内存中的图。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

CliqueCountingMutateResult

abstract stats(G: GraphV2, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) CliqueCountingStatsResult

执行团计数算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

CliqueCountingStatsResult

abstract stream(G: GraphV2, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool | None = False, username: str | None = None) DataFrame

执行团计数算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool | None) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) CliqueCountingWriteResult

执行团计数算法并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • CliqueCountingWriteResult – 算法指标和统计信息

返回类型:

CliqueCountingWriteResult

pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingMutateResult
field compute_millis: int
field configuration: dict[str, Any]
field global_count: list[int]
field mutate_millis: int
field node_properties_written: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingStatsResult
field compute_millis: int
field configuration: dict[str, Any]
field global_count: list[int]
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.CliqueCountingWriteResult
field compute_millis: int
field configuration: dict[str, Any]
field global_count: list[int]
field node_properties_written: int
field pre_processing_millis: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.ConductanceEndpoints
abstract stream(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame

执行导度(Conductance)算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • community_property (str) – 包含社区分配的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含算法结果的 DataFrame,其中含有“community”和“conductance”列

返回类型:

DataFrame

class graphdatascience.procedure_surface.api.community.HdbscanEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult

估算 HDBSCAN 算法的内存需求及其他统计信息。

此方法提供 HDBSCAN 算法的内存估算,而无需实际执行聚类。它有助于在运行实际聚类程序之前确定计算需求。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • node_property (str) – 用于聚类的节点属性(必需)

  • leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小

  • samples (int | None, default=None) – 用于密度估算的样本数量

  • min_cluster_size (int | None, default=None) – 聚类的最小尺寸

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • log_progress – 显示进度日志。

  • sudo – 禁用内存保护。

  • job_id – 计算任务的标识符。

  • username – 作为管理员,模拟其他用户以访问其图。

返回:

包含内存需求及其他统计信息的估算结果

返回类型:

EstimationResult

abstract mutate(G: GraphV2, node_property: str, mutate_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) HdbscanMutateResult

运行 HDBSCAN 算法,并将每个节点的聚类 ID 写回内存中的图。

该算法对节点属性执行层次化密度聚类,根据密度可达性识别聚类。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性(必需)

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小

  • samples (int | None, default=None) – 用于密度估算的样本数量

  • min_cluster_size (int | None, default=None) – 聚类的最小尺寸

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • log_progress (bool) – 显示进度日志。

  • sudo (bool) – 禁用内存保护。

  • job_id (str | None) – 计算任务的标识符。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含有关聚类和算法执行的统计信息的结果

返回类型:

HdbscanMutateResult

abstract stats(G: GraphV2, node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) HdbscanStatsResult

运行 HDBSCAN 算法并仅返回有关聚类的统计信息。

此模式计算聚类分配而不将其写回图中,仅返回执行统计信息和聚类信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性(必需)

  • leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小

  • samples (int | None, default=None) – 用于密度估算的样本数量

  • min_cluster_size (int | None, default=None) – 聚类的最小尺寸

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • log_progress (bool) – 显示进度日志。

  • sudo (bool) – 禁用内存保护。

  • job_id (str | None) – 计算任务的标识符。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含有关聚类和算法执行的统计信息的结果

返回类型:

HdbscanStatsResult

abstract stream(G: GraphV2, node_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None) DataFrame

运行 HDBSCAN 算法并将每个节点的聚类 ID 作为 DataFrame 返回。

DataFrame 包含每个节点的聚类分配,噪声点通常被分配到聚类 -1。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性(必需)

  • leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小

  • samples (int | None, default=None) – 用于密度估算的样本数量

  • min_cluster_size (int | None, default=None) – 聚类的最小尺寸

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • log_progress (bool) – 显示进度日志。

  • sudo (bool) – 禁用内存保护。

  • job_id (str | None) – 计算任务的标识符。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含‘nodeId’和‘label’列的 DataFrame

返回类型:

pd.DataFrame

abstract write(G: GraphV2, node_property: str, write_property: str, *, leaf_size: int = 1, samples: int = 10, min_cluster_size: int = 5, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, job_id: str | None = None, username: str | None = None, write_concurrency: int | None = None) HdbscanWriteResult

运行 HDBSCAN 算法并将每个节点的聚类 ID 写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性(必需)

  • write_property (str) – 用于存储结果的节点属性名称。

  • leaf_size (int | None, default=None) – 算法中使用的树结构的最大叶子节点大小

  • samples (int | None, default=None) – 用于密度估算的样本数量

  • min_cluster_size (int | None, default=None) – 聚类的最小尺寸

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • write_concurrency (int | None) – 用于写入的并发线程数。

  • concurrency (int | None) – 要使用的并发线程数。

  • log_progress (bool) – 显示进度日志。

  • sudo (bool) – 禁用内存保护。

  • job_id (str | None) – 计算任务的标识符。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含有关聚类和算法执行的统计信息的结果

返回类型:

HdbscanWriteResult

pydantic model graphdatascience.procedure_surface.api.community.HdbscanMutateResult
field compute_millis: int
field configuration: dict[str, Any]
field mutate_millis: int
field node_count: int
field node_properties_written: int
field number_of_clusters: int
field number_of_noise_points: int
field post_processing_millis: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.HdbscanStatsResult
field compute_millis: int
field configuration: dict[str, Any]
field node_count: int
field number_of_clusters: int
field number_of_noise_points: int
field post_processing_millis: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.HdbscanWriteResult
field compute_millis: int
field configuration: dict[str, Any]
field node_count: int
field node_properties_written: int
field number_of_clusters: int
field number_of_noise_points: int
field post_processing_millis: int
field pre_processing_millis: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.K1ColoringEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, batch_size: int = 10000, concurrency: int | None = None, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult

预估算法运行的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

返回:

内存预估详情

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) K1ColoringMutateResult

运行 K-1 着色算法并将结果作为新的节点属性存储在图目录中。

K-1 着色算法为图中的每个节点分配一个颜色,旨在优化两个目标:确保给定节点的每个邻居的颜色与该节点自身不同,并尽可能使用最少的颜色。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None, default=None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int, default=10) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

K1ColoringMutateResult

abstract stats(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) K1ColoringStatsResult

执行 K-1 着色算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

K1ColoringStatsResult

abstract stream(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame

执行 K-1 着色算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, batch_size: int = 10000, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) K1ColoringWriteResult

执行 K-1 着色算法并将结果写入 Neo4j 数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • K1ColoringWriteResult – 算法指标和统计信息

返回类型:

K1ColoringWriteResult

pydantic model graphdatascience.procedure_surface.api.community.K1ColoringMutateResult
field color_count: int
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field mutate_millis: int
field node_count: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.K1ColoringStatsResult
field color_count: int
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field node_count: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.K1ColoringWriteResult
field color_count: int
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field node_count: int
field pre_processing_millis: int
field ran_iterations: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.KCoreEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult

预估算法运行的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

返回:

内存预估详情

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) KCoreMutateResult

运行 K-Core 分解算法并将结果作为新的节点属性存储在图目录中。

K-core 分解是一个根据图中节点的度序列和拓扑结构将图中的节点分离成组的过程。术语 i-core 指的是原始图的一个最大子图,使得该子图中的每个节点的度至少为 i。每个节点都关联一个核心值,该值表示节点所属 i-core 的最大值 i

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None, default=None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

KCoreMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) KCoreStatsResult

执行 K-Core 算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

KCoreStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame

执行 K-Core 算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

返回:

包含算法结果(包含 nodeId 和 coreValue)的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, write_concurrency: int | None = None) KCoreWriteResult

执行 K-Core 算法并将结果写入 Neo4j 数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • KCoreWriteResult – 算法指标和统计信息

返回类型:

KCoreWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreMutateResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 degeneracy: int
字段 mutate_millis: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreStatsResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 degeneracy: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.KCoreWriteResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 degeneracy: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
字段 write_millis: int
graphdatascience.procedure_surface.api.community.KMeansEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', k: int = 10, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None) EstimationResult

评估运行 K-Means 算法的内存需求。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • node_property (str) – 用于聚类的节点属性

  • compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数

  • concurrency (int | None) – 要使用的并发线程数。

  • delta_threshold (float) – 迭代之间的最小变化阈值。

  • initial_sampler (str) – 初始质心的采样方法。

  • k (int) – 要形成的聚类数量。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • seed_centroids (可选[list[list[float]]], 默认=None) – 算法的初始质心

返回:

内存估算结果

返回类型:

EstimationResult

abstract mutate(G: GraphV2, node_property: str, mutate_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) KMeansMutateResult

执行 K-Means 算法并将结果作为节点属性写入内存中图。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数

  • concurrency (int | None) – 要使用的并发线程数。

  • delta_threshold (float) – 迭代之间的最小变化阈值。

  • initial_sampler (str) – 初始质心的采样方法。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要形成的聚类数量。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • seed_centroids (可选[list[list[float]]], 默认=None) – 算法的初始质心

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

KMeansMutateResult

abstract stats(G: GraphV2, node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) KMeansStatsResult

执行 K-Means 算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性

  • compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数

  • concurrency (int | None) – 要使用的并发线程数。

  • delta_threshold (float) – 迭代之间的最小变化阈值。

  • initial_sampler (str) – 初始质心的采样方法。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要形成的聚类数量。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • seed_centroids (可选[list[list[float]]], 默认=None) – 算法的初始质心

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

KMeansStatsResult

abstract stream(G: GraphV2, node_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None) DataFrame

执行 K-Means 算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性

  • compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数

  • concurrency (int | None) – 要使用的并发线程数。

  • delta_threshold (float) – 迭代之间的最小变化阈值。

  • initial_sampler (str) – 初始质心的采样方法。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要形成的聚类数量。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • seed_centroids (可选[list[list[float]]], 默认=None) – 算法的初始质心

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含 nodeId、communityId、distanceFromCentroid 和 silhouette 算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, node_property: str, write_property: str, *, compute_silhouette: bool = False, concurrency: int | None = None, delta_threshold: float = 0.05, initial_sampler: str = 'UNIFORM', job_id: str | None = None, k: int = 10, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], number_of_restarts: int = 1, random_seed: int | None = None, relationship_types: list[str] = ['*'], seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) KMeansWriteResult

执行 K-Means 算法并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • node_property (str) – 用于聚类的节点属性

  • write_property (str) – 用于存储结果的节点属性名称。

  • compute_silhouette (bool | None, 默认=False) – 是否计算轮廓系数

  • concurrency (int | None) – 要使用的并发线程数。

  • delta_threshold (float) – 迭代之间的最小变化阈值。

  • initial_sampler (str) – 初始质心的采样方法。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要形成的聚类数量。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • number_of_restarts (int | None, 默认=1) – 算法使用不同初始中心进行重启的次数

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • seed_centroids (可选[list[list[float]]], 默认=None) – 算法的初始质心

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • KMeansWriteResult – 算法指标和统计信息

返回类型:

KMeansWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.KMeansMutateResult
字段 average_distance_to_centroid: float
字段 average_silhouette: float
字段 centroids: list[list[float]]
字段 community_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 mutate_millis: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.KMeansStatsResult
字段 average_distance_to_centroid: float
field average_silhouette: float
field centroids: list[list[float]]
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field post_processing_millis: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.KMeansWriteResult
field average_distance_to_centroid: float
field average_silhouette: float
field centroids: list[list[float]]
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.LabelPropagationEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None) EstimationResult

估算运行标签传播(Label Propagation)算法所需的内存。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • node_weight_property (str | None, default=None) – 节点权重的属性名称

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

返回:

内存估算结果

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) LabelPropagationMutateResult

执行标签传播算法,并将结果作为节点属性写入内存图。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • node_weight_property (str | None, default=None) – 节点权重的属性名称

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

LabelPropagationMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) LabelPropagationStatsResult

执行标签传播算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • node_weight_property (str | None, default=None) – 节点权重的属性名称

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

LabelPropagationStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame

执行标签传播算法并以数据流形式返回结果。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • node_weight_property (str | None, default=None) – 节点权重的属性名称

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含 nodeID 和 communityID 算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], node_weight_property: str | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) LabelPropagationWriteResult

执行标签传播算法并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • node_weight_property (str | None, default=None) – 节点权重的属性名称

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • LabelPropagationWriteResult – 算法指标和统计信息

返回类型:

LabelPropagationWriteResult

pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationMutateResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field mutate_millis: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationStatsResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.LabelPropagationWriteResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.LeidenEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, theta: float = 0.01, tolerance: float = 0.0001) EstimationResult

估算运行 Leiden 算法所需的内存。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • gamma (float, default=1.0) – Leiden 算法的 gamma 参数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • max_levels (int, default=10) – 最大层数

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • theta (float, default=0.01) – Leiden 算法的 theta 参数

  • tolerance (float) – 迭代间得分的最小变化量。

返回:

内存估算结果

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) LeidenMutateResult

执行 Leiden 社区发现算法,并将结果作为节点属性写入内存中图。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • gamma (float, default=1.0) – Leiden 算法的 gamma 参数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_levels (int, default=10) – 最大层数

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • theta (float, default=0.01) – Leiden 算法的 theta 参数

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

LeidenMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) LeidenStatsResult

执行 Leiden 社区发现算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • gamma (float, default=1.0) – Leiden 算法的 gamma 参数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_levels (int, default=10) – 最大层数

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • theta (float, default=0.01) – Leiden 算法的 theta 参数

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

LeidenStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None) DataFrame

执行 Leiden 社区发现算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • gamma (float, default=1.0) – Leiden 算法的 gamma 参数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_levels (int, default=10) – 最大层数

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • theta (float, default=0.01) – Leiden 算法的 theta 参数

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含以下列的 DataFrame:nodeId, communityId, intermediateCommunityIds

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, gamma: float = 1.0, include_intermediate_communities: bool = False, job_id: str | None = None, log_progress: bool = True, max_levels: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None, write_concurrency: int | None = None) LeidenWriteResult

执行 Leiden 社区发现算法并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • gamma (float, default=1.0) – Leiden 算法的 gamma 参数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_levels (int, default=10) – 最大层数

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • theta (float, default=0.01) – Leiden 算法的 theta 参数

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • LeidenWriteResult – 算法指标和统计信息

返回类型:

LeidenWriteResult

pydantic model graphdatascience.procedure_surface.api.community.LeidenMutateResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularities: list[float]
field modularity: float
field mutate_millis: int
field node_count: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
pydantic model graphdatascience.procedure_surface.api.community.LeidenStatsResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularities: list[float]
field modularity: float
field node_count: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
pydantic model graphdatascience.procedure_surface.api.community.LeidenWriteResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularities: list[float]
field modularity: float
field node_count: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientEndpoints

LocalClusteringCoefficient 算法端点的接口。

abstract estimate(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool | None = False, triangle_count_property: str | None = None, username: str | None = None) EstimationResult

估算 LocalClusteringCoefficient 算法的内存需求。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool | None) – 禁用内存保护。

  • triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

内存预估详情

返回类型:

EstimationResult

abstract mutate(G: GraphV2, *, mutate_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) LocalClusteringCoefficientMutateResult

执行 LocalClusteringCoefficient 算法并将结果写回图中。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含聚类系数统计信息和计时信息的结果

返回类型:

LocalClusteringCoefficientMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) LocalClusteringCoefficientStatsResult

执行局部聚类系数算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含聚类系数统计信息和计时信息的结果

返回类型:

LocalClusteringCoefficientStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None) DataFrame

执行局部聚类系数算法并以流形式返回结果。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含 nodeId 和 localClusteringCoefficient 列的 DataFrame

返回类型:

pandas.DataFrame

abstract write(G: GraphV2, *, write_property: str, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, triangle_count_property: str | None = None, username: str | None = None, write_concurrency: int | None = None) LocalClusteringCoefficientWriteResult

执行局部聚类系数算法并将结果写入数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • triangle_count_property (str | None, 默认=None) – 预计算三角形计数的属性名称

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • LocalClusteringCoefficientWriteResult – 包含聚类系数统计信息和计时结果的结果

返回类型:

LocalClusteringCoefficientWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientMutateResult
字段 average_clustering_coefficient: float
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 mutate_millis: int
字段 node_count: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientStatsResult
字段 average_clustering_coefficient: float
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 node_count: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.LocalClusteringCoefficientWriteResult
字段 average_clustering_coefficient: float
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 node_count: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
字段 write_millis: int
class graphdatascience.procedure_surface.api.community.LouvainEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) EstimationResult

预估算法运行的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • tolerance (float) – 迭代间得分的最小变化量。

  • max_levels (int, 默认=10) – 分层结构中的最大层级数

  • include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配

  • max_iterations (int) – 每个层级运行的最大迭代次数。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

包含估计结果的对象

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) LouvainMutateResult

运行 Louvain 算法并将结果以新的节点属性形式存储在图目录中。

Louvain 方法是一种用于检测大型网络中社群的算法。它为每个社群最大化一个模块度(modularity)分数。模块度通过评估节点在社群内的连接密度与随机网络中预期连接密度的对比,从而量化社群划分的质量。Louvain 算法是一种分层聚类算法,它递归地将社群合并为单个节点,并在压缩后的图上运行模块度聚类。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • tolerance (float) – 迭代间得分的最小变化量。

  • max_levels (int, 默认=10) – 分层结构中的最大层级数

  • include_intermediate_communities (bool, default=False) – 是否包含中间社区

  • max_iterations (int) – 每个层级运行的最大迭代次数。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None, default=None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

算法指标和统计信息

返回类型:

LouvainMutateResult

abstract stats(G: GraphV2, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) LouvainStatsResult

执行 Louvain 算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • tolerance (float) – 迭代间得分的最小变化量。

  • max_levels (int, 默认=10) – 分层结构中的最大层级数

  • include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配

  • max_iterations (int) – 每个层级运行的最大迭代次数。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

算法指标和统计信息

返回类型:

LouvainStatsResult

abstract stream(G: GraphV2, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, min_community_size: int | None = None) DataFrame

执行 Louvain 算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • tolerance (float) – 迭代间得分的最小变化量。

  • max_levels (int, 默认=10) – 分层结构中的最大层级数

  • include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配

  • max_iterations (int) – 每个层级运行的最大迭代次数。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

返回:

包含算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, tolerance: float = 0.0001, max_levels: int = 10, include_intermediate_communities: bool = False, max_iterations: int = 10, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, write_concurrency: int | None = None, min_community_size: int | None = None) LouvainWriteResult

执行 Louvain 算法并将结果写入 Neo4j 数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • tolerance (float) – 迭代间得分的最小变化量。

  • max_levels (int, 默认=10) – 分层结构中的最大层级数

  • include_intermediate_communities (bool, 默认=False) – 是否包含中间社群分配

  • max_iterations (int) – 每个层级运行的最大迭代次数。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • write_concurrency (int | None) – 用于写入的并发线程数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

返回:

算法指标和统计信息

返回类型:

LouvainWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.LouvainMutateResult
字段 community_count: int
字段 community_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 modularities: list[float]
field modularity: float
field mutate_millis: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
pydantic model graphdatascience.procedure_surface.api.community.LouvainStatsResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field modularities: list[float]
field modularity: float
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
pydantic model graphdatascience.procedure_surface.api.community.LouvainWriteResult
field community_count: int
field community_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field modularities: list[float]
field modularity: float
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_levels: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.MaxKCutEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, iterations: int = 8, k: int = 2, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, random_seed: int | None = None, vns_max_neighborhood_order: int = 0) EstimationResult

估算运行近似最大 K-割(Approximate Maximum k-cut)算法所需的内存。

此方法提供内存估算,而无需实际运行该算法,帮助您确定是否有足够的可用内存。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • iterations (int) – 要运行的迭代次数。

  • k (int) – 要检测的社区数量。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索(Variable Neighborhood Search)的最大邻域阶数。

返回:

内存估算结果,包括以字节为单位的所需内存和堆内存占比。

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, iterations: int = 8, job_id: str | None = None, k: int = 2, log_progress: bool = True, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None, vns_max_neighborhood_order: int = 0) MaxKCutMutateResult

执行近似最大 K-割算法,并将结果作为节点属性写入内存中的图。

近似最大 K-割算法是一种社区检测算法,它将图划分为 K 个社区,使得不同社区之间边的权重之和最大化。它使用变邻域搜索(VNS)方法来寻找高质量的割。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • iterations (int) – 要运行的迭代次数。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要检测的社区数量。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索的最大邻域阶数。更高的值可能会获得更好的结果,但会增加计算时间。

返回:

算法指标和统计数据,包括割成本和处理时间。

返回类型:

MaxKCutMutateResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, iterations: int = 8, job_id: str | None = None, k: int = 2, log_progress: bool = True, min_community_size: int | None = None, node_labels: list[str] = ['*'], random_seed: int | None = None, relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None, vns_max_neighborhood_order: int = 0) DataFrame

执行近似最大 K-割算法并返回结果流。

近似最大 K-割算法将图划分为 K 个社区以最大化割成本。此方法以流的形式返回每个节点的社区分配。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • iterations (int) – 要运行的迭代次数。

  • job_id (str | None) – 计算任务的标识符。

  • k (int) – 要检测的社区数量。

  • log_progress (bool) – 显示进度日志。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • random_seed (int | None) – 随机数生成的种子,以确保结果的可复现性。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • vns_max_neighborhood_order (int | None, default=0) – 变邻域搜索的最大邻域阶数。更高的值可能会获得更好的结果,但会增加计算时间。

返回:

一个 DataFrame,包含以下列: - nodeId:节点标识符 - communityId:节点的社区分配

返回类型:

DataFrame

pydantic model graphdatascience.procedure_surface.api.community.MaxKCutMutateResult
field compute_millis: int
field configuration: dict[str, Any]
field cut_cost: float
field mutate_millis: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
class graphdatascience.procedure_surface.api.community.ModularityEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], community_property: str, *, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None) EstimationResult

估算模块度(Modularity)算法的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • community_property (str) – 包含社区分配的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

包含估计结果的对象

返回类型:

EstimationResult

abstract stats(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) ModularityStatsResult

执行模块度算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • community_property (str) – 包含社区分配的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法统计信息,包括 communityCount(社区数量)、modularity(模块度)、nodeCount(节点数量)和 relationshipCount(关系数量)。

返回类型:

ModularityStatsResult

abstract stream(G: GraphV2, community_property: str, *, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, sudo: bool = False, username: str | None = None) DataFrame

执行模块度算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • community_property (str) – 包含社区分配的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含算法结果的 DataFrame,其中含有 ‘communityId’ 和 ‘modularity’ 列。

返回类型:

DataFrame

class graphdatascience.procedure_surface.api.community.ModularityOptimizationEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, tolerance: float = 0.0001) EstimationResult

估算运行模块度优化(Modularity Optimization)算法的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • tolerance (float) – 迭代间得分的最小变化量。

返回:

估算的内存消耗及其他指标。

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) ModularityOptimizationMutateResult

执行模块化优化算法,并将结果作为节点属性写入内存图。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含社区统计信息和计时信息的计算结果

返回类型:

ModularityOptimizationMutateResult

abstract stats(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) ModularityOptimizationStatsResult

执行模块化优化算法,并返回有关社区的统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含社区统计信息和计时信息的计算结果

返回类型:

ModularityOptimizationStatsResult

abstract stream(G: GraphV2, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None) DataFrame

执行模块化优化算法,并以 DataFrame 形式返回结果。

参数:
  • G (GraphV2) – 要使用的图对象

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含 ‘nodeId’ 和 ‘communityId’ 列的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, batch_size: int = 10000, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, max_iterations: int = 10, min_community_size: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], relationship_weight_property: str | None = None, seed_property: str | None = None, sudo: bool = False, tolerance: float = 0.0001, username: str | None = None, write_concurrency: int | None = None) ModularityOptimizationWriteResult

执行模块化优化算法,并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • batch_size (int) – 每个批次处理的节点数量。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • max_iterations (int) – 运行的最大迭代次数。

  • min_community_size (int | None) – 结果中包含的社区的最小大小。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • sudo (bool) – 禁用内存保护。

  • tolerance (float) – 迭代间得分的最小变化量。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • ModularityOptimizationWriteResult – 包含社区统计信息和计时信息的计算结果

返回类型:

ModularityOptimizationWriteResult

pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationMutateResult
field community_count: int
field community_distribution: dict[str, float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularity: float
field mutate_millis: int
field nodes: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationStatsResult
field community_count: int
field community_distribution: dict[str, float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularity: float
field nodes: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
pydantic model graphdatascience.procedure_surface.api.community.ModularityOptimizationWriteResult
field community_count: int
field community_distribution: dict[str, float]
field compute_millis: int
field configuration: dict[str, Any]
field did_converge: bool
field modularity: float
field nodes: int
field post_processing_millis: int
field pre_processing_millis: int
field ran_iterations: int
field write_millis: int
pydantic model graphdatascience.procedure_surface.api.community.ModularityStatsResult

模块化统计算法的结果对象。

field community_count: int
field compute_millis: int
field configuration: dict[str, Any]
field modularity: float
field node_count: int
field post_processing_millis: int
field pre_processing_millis: int
field relationship_count: int
class graphdatascience.procedure_surface.api.community.SccEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, consecutive_ids: bool = False, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult

预估算法运行的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

返回:

内存预估详情

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SccMutateResult

运行强连通分量 (SCC) 算法,并将结果作为新的节点属性存储在图目录中。

强连通分量 (SCC) 算法在有向图中查找最大连通节点集。如果一个集合中的每对节点之间都存在有向路径,则该集合被视为一个强连通分量。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None, default=None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

SccMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SccStatsResult

执行 SCC 算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息

返回类型:

SccStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame

执行 SCC 算法并返回结果流。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, consecutive_ids: bool = False, job_id: str | None = None, log_progress: bool = True, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) SccWriteResult

执行 SCC(强连通分量)算法并将结果写入 Neo4j 数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • SccWriteResult – 算法指标与统计信息

返回类型:

SccWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.SccMutateResult
字段 component_count: int
字段 component_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 mutate_millis: int
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.SccStatsResult
字段 component_count: int
字段 component_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.SccWriteResult
字段 component_count: int
字段 component_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
字段 write_millis: int
graphdatascience.procedure_surface.api.community.SllpaEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, max_iterations: int, concurrency: int | None = None, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*']) EstimationResult

估算运行说话人-听众标签传播(SLLPA)算法所需的内存。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • partitioning (str | None) – 算法的分区配置

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • max_iterations (int)

返回:

包含内存估算结果的对象

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SllpaMutateResult

执行说话人-听众标签传播(SLLPA)算法,并将结果作为节点属性写入内存图。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • max_iterations (int) – 运行的最大迭代次数。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • partitioning (str | None) – 算法的分区配置

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含有关算法执行和突变(mutate)操作元数据的对象

返回类型:

SllpaMutateResult

abstract stats(G: GraphV2, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) SllpaStatsResult

执行说话人-听众标签传播(SLLPA)算法并返回关于社区的统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • partitioning (str | None) – 算法的分区配置

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • max_iterations (int)

返回:

包含关于算法执行统计信息的对象

返回类型:

SllpaStatsResult

abstract stream(G: GraphV2, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame

执行说话人-听众标签传播(SLLPA)算法,并以 DataFrame 的形式返回结果。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • partitioning (str | None) – 算法的分区配置

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • max_iterations (int)

返回:

包含节点 ID 及其社区值的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, max_iterations: int, concurrency: int | None = None, job_id: str | None = None, log_progress: bool = True, min_association_strength: float = 0.2, node_labels: list[str] = ['*'], partitioning: str = 'RANGE', relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) SllpaWriteResult

执行说话人-听众标签传播(SLLPA)算法,并将结果写回数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • log_progress (bool) – 显示进度日志。

  • min_association_strength (float | None, 默认=None) – 社区分配的最小关联强度

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • partitioning (str | None) – 算法的分区配置

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • SllpaWriteResult – 包含有关算法执行和写入操作元数据的对象

  • max_iterations (int)

返回类型:

SllpaWriteResult

pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaMutateResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 did_converge: bool
字段 mutate_millis: int
字段 node_properties_written: int
字段 pre_processing_millis: int
字段 ran_iterations: int
pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaStatsResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 did_converge: bool
字段 pre_processing_millis: int
字段 ran_iterations: int
pydantic 模型 graphdatascience.procedure_surface.api.community.SllpaWriteResult
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 did_converge: bool
字段 node_properties_written: int
字段 pre_processing_millis: int
字段 ran_iterations: int
字段 write_millis: int
graphdatascience.procedure_surface.api.community.TriangleCountEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], *, concurrency: int | None = None, label_filter: list[str] | None = None, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult

估算运行三角计数(Triangle Count)算法所需的内存要求。

此方法提供内存估算,而无需实际运行该算法,帮助您确定是否有足够的可用内存。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • concurrency (int | None) – 要使用的并发线程数。

  • label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。

  • max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

返回:

内存估算结果,包括以字节为单位的所需内存和堆内存占比。

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) TriangleCountMutateResult

执行三角形计数(Triangle Count)算法并将结果以节点属性的形式写入内存图。

三角形计数算法计算每个节点参与的三角形数量。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。

  • log_progress (bool) – 显示进度日志。

  • max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法指标和统计信息,包括全局三角形计数和处理时间

返回类型:

TriangleCountMutateResult

abstract stats(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) TriangleCountStatsResult

执行三角形计数算法并返回关于计算的统计信息。

此方法计算三角形数量而不将结果存储在图中,提供关于图三角形结构的聚合统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。

  • log_progress (bool) – 显示进度日志。

  • max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

算法统计信息,包括全局三角形计数和处理时间

返回类型:

TriangleCountStatsResult

abstract stream(G: GraphV2, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None) DataFrame

执行三角形计数算法并以流形式返回结果。

三角形计数算法计算每个节点参与的三角形数量。此方法以流形式返回每个节点的三角形计数。

参数:
  • G (GraphV2) – 要使用的图对象

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。

  • log_progress (bool) – 显示进度日志。

  • max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

返回:

包含以下列的 DataFrame: - nodeId:节点标识符 - triangleCount:节点参与的三角形数量

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, *, concurrency: int | None = None, job_id: str | None = None, label_filter: list[str] | None = None, log_progress: bool = True, max_degree: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*'], sudo: bool = False, username: str | None = None, write_concurrency: int | None = None) TriangleCountWriteResult

执行三角形计数算法并将结果写回数据库。

此方法计算三角形数量并将结果直接以节点属性的形式写入 Neo4j 数据库,使其可用于后续的 Cypher 查询。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • label_filter (list[str] | None, 默认=None) – 按节点标签过滤三角形。仅计算所有节点均具有指定标签之一的三角形。

  • log_progress (bool) – 显示进度日志。

  • max_degree (int | None, 默认=None) – 要考虑的节点最大度数。度数高于此值的节点将从三角计数中排除,以提高性能。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • sudo (bool) – 禁用内存保护。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • write_concurrency (int | None) – 用于写入的并发线程数。

返回:

算法指标和统计信息,包括全局三角形计数和处理时间

返回类型:

TriangleCountWriteResult

pydantic model graphdatascience.procedure_surface.api.community.TriangleCountMutateResult
field compute_millis: int
field configuration: dict[str, Any]
field global_triangle_count: int
field mutate_millis: int
field node_count: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.TriangleCountStatsResult
field compute_millis: int
field configuration: dict[str, Any]
field global_triangle_count: int
field node_count: int
field post_processing_millis: int
field pre_processing_millis: int
pydantic model graphdatascience.procedure_surface.api.community.TriangleCountWriteResult
field compute_millis: int
field configuration: dict[str, Any]
field global_triangle_count: int
field node_count: int
field node_properties_written: int
field post_processing_millis: int
field pre_processing_millis: int
field write_millis: int
class graphdatascience.procedure_surface.api.community.WccEndpoints
abstract estimate(G: GraphV2 | dict[str, Any], threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) EstimationResult

预估算法运行的内存消耗。

参数:
  • G (GraphV2 | dict[str, Any]) – 要使用的图对象或表示图维度的字典。

  • threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • concurrency (int | None) – 要使用的并发线程数。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

内存预估详情

返回类型:

EstimationResult

abstract mutate(G: GraphV2, mutate_property: str, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) WccMutateResult

运行弱连通分量(WCC)算法,并将结果作为新的节点属性存储在图目录中。

弱连通分量(WCC)算法在有向图和无向图中查找连通节点集,如果两个节点之间存在路径,则称它们是连通的。与强连通分量(SCC)不同,该算法不考虑节点间路径中关系的方向。

参数:
  • G (GraphV2) – 要使用的图对象

  • mutate_property (str) – 用于存储结果的节点属性名称。

  • threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None, default=None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

算法指标和统计信息

返回类型:

WccMutateResult

abstract stats(G: GraphV2, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) WccStatsResult

执行 WCC 算法并返回统计信息。

参数:
  • G (GraphV2) – 要使用的图对象

  • threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

算法指标和统计信息

返回类型:

WccStatsResult

abstract stream(G: GraphV2, min_component_size: int | None = None, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None) DataFrame

执行 WCC 算法并以流形式返回结果。

参数:
  • G (GraphV2) – 要使用的图对象

  • min_component_size (int | None, default=None) – 不流式传输节点数少于此值的组件

  • threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

返回:

包含算法结果的 DataFrame

返回类型:

DataFrame

abstract write(G: GraphV2, write_property: str, min_component_size: int | None = None, threshold: float = 0.0, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, log_progress: bool = True, username: str | None = None, concurrency: int | None = None, job_id: str | None = None, seed_property: str | None = None, consecutive_ids: bool = False, relationship_weight_property: str | None = None, write_concurrency: int | None = None) WccWriteResult

执行 WCC 算法并将结果写入 Neo4j 数据库。

参数:
  • G (GraphV2) – 要使用的图对象

  • write_property (str) – 用于存储结果的节点属性名称。

  • min_component_size (int | None, default=None) – 不写入节点数少于此值的组件

  • threshold (float, default=0.0) – 在遍历过程中考虑关系时所需的最小权重

  • relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。

  • node_labels (list[str]) – 使用给定的节点标签过滤图。将包含具有任何给定标签的节点。

  • sudo (bool) – 禁用内存保护。

  • log_progress (bool) – 显示进度日志。

  • username (str | None) – 作为管理员,模拟其他用户以访问其图。

  • concurrency (int | None) – 要使用的并发线程数。

  • job_id (str | None) – 计算任务的标识符。

  • seed_property (str | None) – 用于节点初始值的属性名称。

  • consecutive_ids (bool) – 为组件使用连续的 ID。

  • relationship_weight_property (str | None) – 用作权重的属性名称。

  • write_concurrency (int | None) – 用于写入的并发线程数。返回

  • -------

  • WccWriteResult – 算法指标和统计信息

返回类型:

WccWriteResult

pydantic model graphdatascience.procedure_surface.api.community.WccMutateResult
field component_count: int
field component_distribution: dict[str, int | float]
field compute_millis: int
field configuration: dict[str, Any]
field mutate_millis: int
field node_properties_written: int
field post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.WccStatsResult
字段 component_count: int
字段 component_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 post_processing_millis: int
字段 pre_processing_millis: int
pydantic 模型 graphdatascience.procedure_surface.api.community.WccWriteResult
字段 component_count: int
字段 component_distribution: dict[str, int | float]
字段 compute_millis: int
字段 configuration: dict[str, Any]
字段 node_properties_written: int
字段 post_processing_millis: int
字段 pre_processing_millis: int
字段 write_millis: int
© . This site is unofficial and not affiliated with Neo4j, Inc.