寻路算法¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.AStarMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.AStarWriteResult¶
- 类 graphdatascience.procedure_surface.api.pathfinding.AllShortestPathEndpoints¶
用于从给定源节点获取最短路径算法端点的容器。提供对诸如 Delta Stepping、Dijkstra 和 Bellman-Ford 等不同最短路径算法的访问。
- 抽象 属性 delta: SingleSourceDeltaEndpoints¶
访问 Delta Stepping 最短路径算法端点。
- 抽象 属性 dijkstra: SingleSourceDijkstraEndpoints¶
访问 Dijkstra 最短路径算法端点。
- 抽象 estimate(G: GraphV2 | dict[str, Any], *, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算“所有最短路径”算法的内存需求。
- 抽象 stream(G: GraphV2, *, 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) – 要使用的图对象
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含算法结果的 DataFrame,具有 ‘sourceNodeId’、‘targetNodeId’ 和 ‘distance’ 列。
- 返回类型:
DataFrame
- 类 graphdatascience.procedure_surface.api.pathfinding.BFSEndpoints¶
- 抽象 estimate(G: GraphV2 | dict[str, Any], source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult¶
预估算法运行的内存消耗。
- 抽象 mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, 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) BFSMutateResult¶
运行广度优先搜索 (BFS) 算法,并将结果作为新关系存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – BFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法指标和统计信息
- 返回类型:
- 抽象 stats(G: GraphV2, source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, 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) BFSStatsResult¶
运行广度优先搜索 (BFS) 算法并返回结果统计信息,而不存储结果。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – BFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法统计信息
- 返回类型:
- 抽象 stream(G: GraphV2, source_node: int, target_nodes: int | list[int] | None = None, max_depth: int = -1, 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) DataFrame¶
运行广度优先搜索 (BFS) 算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – BFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含 sourceNode 和 nodeIds 列的 DataFrame。
- 返回类型:
DataFrame
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.BFSMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.BFSStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.BellmanFordMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.BellmanFordStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.BellmanFordWriteResult¶
- 类 graphdatascience.procedure_surface.api.pathfinding.DFSEndpoints¶
- 抽象 estimate(G: GraphV2 | dict[str, Any], source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], concurrency: int | None = None) EstimationResult¶
预估算法运行的内存消耗。
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, 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) DFSMutateResult¶
运行深度优先搜索 (DFS) 算法,并将结果作为新关系存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – DFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, source_node: int, target_nodes: int | list[int] = [], max_depth: int = -1, 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) DFSStatsResult¶
运行深度优先搜索 (DFS) 算法并返回结果统计信息,而不存储结果。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – DFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
算法统计信息
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_nodes: int | list[int] | None = None, max_depth: int = -1, 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) DataFrame¶
运行深度优先搜索 (DFS) 算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_nodes (int | list[int], 默认=[]) – DFS 计算的单个目标节点或目标节点列表。
max_depth (int) – 搜索的最大深度。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含 sourceNode 和 nodeIds 列的 DataFrame。
- 返回类型:
DataFrame
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DFSMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DFSStatsResult¶
- 类 graphdatascience.procedure_surface.api.pathfinding.DagEndpoints¶
有向无环图 (DAG) 算法端点的容器。
- abstract 属性 longest_path: LongestPathEndpoints¶
访问 DAG 的最长路径算法端点。
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DeltaSteppingMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DeltaSteppingStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DeltaSteppingWriteResult¶
- 类 graphdatascience.procedure_surface.api.pathfinding.DijkstraEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估计运行 Dijkstra 最短路径算法的内存需求。
Dijkstra 算法计算加权图中从源节点到一个或多个目标节点的最短路径。
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, 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) DijkstraMutateResult¶
运行 Dijkstra 最短路径算法,并将结果作为新关系存储在图目录中。
Dijkstra 算法计算加权图中从源节点到一个或多个目标节点的最短路径,并在内存中的图中创建表示这些路径的关系。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, 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) DataFrame¶
运行 Dijkstra 最短路径算法并以 DataFrame 形式返回结果。
Dijkstra 算法计算加权图中从源节点到一个或多个目标节点的最短路径。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, source_node: int, target_nodes: int | list[int], write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) DijkstraWriteResult¶
运行 Dijkstra 最短路径算法并将结果写回数据库。
Dijkstra 算法计算加权图中从源节点到一个或多个目标节点的最短路径,并将路径作为关系写入。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
source_node (int) – 用作起点的节点 ID。
write_node_ids (bool, 默认=False) – 是否沿路径写入节点 ID。
write_costs (bool, 默认=False) – 是否沿路径写入成本。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
DijkstraWriteResult – 包含执行元数据的对象。
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DijkstraMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DijkstraStreamResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.DijkstraWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.KSpanningTreeEndpoints¶
- abstract write(G: GraphV2, k: int, write_property: str, source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', 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) KSpanningTreeWriteResult¶
运行 k-生成树(k-Spanning tree)算法并将结果写回 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
k (int) – 要计算的生成树数量。
write_property (str) – 用于存储结果的节点属性名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
KSpanningTreeWriteResult – 包含统计信息和计时信息的计算结果。
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.pathfinding.KSpanningTreeWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.LongestPathEndpoints¶
- abstract stream(G: GraphV2, *, relationship_weight_property: str | None = None, 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) DataFrame¶
在有向无环图(DAG)中运行最长路径算法,并将结果以 DataFrame 形式返回。
- 参数:
G (GraphV2) – 要使用的图对象
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最长路径结果以 DataFrame 形式呈现,包含 index、sourceNode、targetNode、totalCost、nodeIds 和 costs 等列。
- 返回类型:
DataFrame
- class graphdatascience.procedure_surface.api.pathfinding.MaxFlowEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
预估算法运行的内存消耗。
- abstract property min_cost: MaxFlowMinCostEndpoints¶
最小费用最大流(Min-Cost Max Flow)算法端点容器。
- abstract mutate(G: GraphV2, source_nodes: list[int], target_nodes: list[int], mutate_property: str, mutate_relationship_type: str, *, capacity_property: str | None = None, node_capacity_property: str | None = None, 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) MaxFlowMutateResult¶
运行最大流(Max Flow)算法并将结果存储在图目录(graph catalog)中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, 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) MaxFlowStatsResult¶
运行最大流(Max Flow)算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, 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¶
运行最大流(Max Flow)算法并返回结果流。
- 参数:
G (GraphV2) – 要使用的图对象
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
包含算法结果的 DataFrame,具有‘source’、‘target’和‘flow’列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, source_nodes: list[int], target_nodes: list[int], write_property: str, write_relationship_type: str, *, capacity_property: str | None = None, node_capacity_property: str | None = None, 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) MaxFlowWriteResult¶
运行最大流(Max Flow)算法并将结果写入 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_property (str) – 用于存储结果的节点属性名称。
write_relationship_type (str) – 用于存储结果的关系类型的名称。
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
write_concurrency (int | None) – 用于写入的并发线程数。
- 返回:
算法指标和统计信息
- 返回类型:
- class graphdatascience.procedure_surface.api.pathfinding.MaxFlowMinCostEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, cost_property: str | None = None, alpha: int = 6, concurrency: int | None = None, node_labels: list[str] = ['*'], relationship_types: list[str] = ['*']) EstimationResult¶
预估算法运行的内存消耗。
- abstract mutate(G: GraphV2, source_nodes: list[int], target_nodes: list[int], mutate_property: str, mutate_relationship_type: str, *, capacity_property: str | None = None, node_capacity_property: str | None = None, cost_property: str | None = None, alpha: int = 6, 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) MaxFlowMinCostMutateResult¶
运行最小费用最大流(Min-Cost Max Flow)算法并将结果存储在图目录(graph catalog)中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_property (str) – 用于存储结果的节点属性名称。
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
cost_property (str | None) – 包含成本的关联属性名称。
alpha (int) – 算法细化阶段的成本缩放率。调整该参数可以提高速度。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stats(G: GraphV2, source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, cost_property: str | None = None, alpha: int = 6, 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) MaxFlowMinCostStatsResult¶
运行最小费用最大流算法并返回统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
capacity_property (str | None) – 包含容量的关系属性名称。
node_capacity_property (str | None) – 包含容量的节点属性名称。
cost_property (str | None) – 包含成本的关联属性名称。
alpha (int) – 算法细化阶段的成本缩放率。调整该参数可以提高速度。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
log_progress (bool) – 显示进度日志。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
- 返回:
算法指标和统计信息
- 返回类型:
- abstract stream(G: GraphV2, source_nodes: list[int], target_nodes: list[int], *, capacity_property: str | None = None, node_capacity_property: str | None = None, cost_property: str | None = None, alpha: int = 6, 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¶
运行最小费用最大流算法并流式传输(stream)各关系上的流量。
- abstract write(G: GraphV2, source_nodes: list[int], target_nodes: list[int], write_property: str, write_relationship_type: str, *, capacity_property: str | None = None, node_capacity_property: str | None = None, cost_property: str | None = None, alpha: int = 6, 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) MaxFlowMinCostWriteResult¶
运行最小费用最大流算法并将结果写入 Neo4j 数据库。
- 返回:
算法指标和统计信息
- 返回类型:
- 参数:
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowMinCostMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowMinCostStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowMinCostWriteResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.MaxFlowWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.PrizeSteinerTreeEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], prize_property: str, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算运行有奖斯坦纳树(Prize Steiner tree)算法所需的内存需求。
- abstract mutate(G: GraphV2, mutate_relationship_type: str, mutate_property: str, prize_property: str, relationship_weight_property: str | None = None, 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) PrizeSteinerTreeMutateResult¶
运行有奖斯坦纳树算法,并将结果作为新关系添加到内存图(in-memory graph)中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
mutate_property (str) – 用于存储结果的节点属性名称。
prize_property (str) – 包含奖励值的节点属性名称。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含统计信息和计时信息的运行结果。
- 返回类型:
- abstract stats(G: GraphV2, prize_property: str, relationship_weight_property: str | None = None, 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) PrizeSteinerTreeStatsResult¶
以统计模式运行奖赏斯坦纳树(Prize Steiner tree)算法,返回统计信息而不修改图。
- 参数:
G (GraphV2) – 要使用的图对象
prize_property (str) – 包含奖励值的节点属性名称。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
关于计算出的奖赏斯坦纳树的统计信息。
- 返回类型:
- abstract stream(G: GraphV2, prize_property: str, relationship_weight_property: str | None = None, 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) DataFrame¶
运行奖赏斯坦纳树算法,并将结果作为 DataFrame 返回。
- 参数:
G (GraphV2) – 要使用的图对象
prize_property (str) – 包含奖励值的节点属性名称。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含树边的 DataFrame,具有以下列:nodeId, parentId, weight。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, write_property: str, prize_property: str, relationship_weight_property: str | None = None, 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) PrizeSteinerTreeWriteResult¶
运行奖赏斯坦纳树算法,并将结果写回 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
write_property (str) – 用于存储结果的节点属性名称。
prize_property (str) – 包含奖励值的节点属性名称。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
PrizeSteinerTreeWriteResult – 包含统计信息和计时信息的运行结果。
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.pathfinding.PrizeSteinerTreeMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.PrizeSteinerTreeStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.PrizeSteinerTreeWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.ShortestPathEndpoints¶
最短路径算法端点容器。提供对诸如 Dijkstra 和 A* 等不同最短路径算法的访问。
- abstract property a_star: SourceTargetAStarEndpoints¶
访问 A* 最短路径算法端点。
- abstract property dijkstra: SourceTargetDijkstraEndpoints¶
访问 Dijkstra 最短路径算法端点。
- abstract property yens: SourceTargetYensEndpoints¶
访问 Yen 的 K 条最短路径算法端点。
- class graphdatascience.procedure_surface.api.pathfinding.SingleSourceBellmanFordEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估计运行 Bellman-Ford 最短路径算法的内存需求。
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, mutate_negative_cycles: bool = False, relationship_weight_property: str | None = None, 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) BellmanFordMutateResult¶
运行 Bellman-Ford 最短路径算法,并将结果作为新关系存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
mutate_negative_cycles (bool, 默认=False) – 是否将负环写入内存图。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象,包括是否检测到负环。
- 返回类型:
- abstract stats(G: GraphV2, source_node: int, relationship_weight_property: str | None = None, 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) BellmanFordStatsResult¶
运行 Bellman-Ford 最短路径算法,并返回关于执行的统计信息。
Bellman-Ford 算法可以检测图中的负环。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行统计信息的对象,包括是否检测到负环。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, relationship_weight_property: str | None = None, 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) DataFrame¶
运行 Bellman-Ford 最短路径算法,并将结果作为 DataFrame 返回。
Bellman-Ford 算法可以检测图中的负环。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
以 DataFrame 形式返回的最短路径结果,包含列:sourceNode, targetNode, totalCost, nodeIds, costs, index 和 isNegativeCycle。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, source_node: int, write_node_ids: bool = False, write_costs: bool = False, write_negative_cycles: bool = False, relationship_weight_property: str | None = None, 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) BellmanFordWriteResult¶
运行 Bellman-Ford 最短路径算法,并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
source_node (int) – 用作起点的节点 ID。
write_node_ids (bool, 默认=False) – 是否将最短路径的节点 ID 写入关系。
write_costs (bool, 默认=False) – 是否将最短路径的成本写入关系。
write_negative_cycles (bool, 默认=False) – 是否将负环写入数据库。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
BellmanFordWriteResult – 包含执行元数据的对象,包括是否检测到负环。
- 返回类型:
- class graphdatascience.procedure_surface.api.pathfinding.SingleSourceDeltaEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, *, delta: float = 2.0, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估计运行 Delta Stepping 最短路径算法所需的内存需求。
- 参数:
- 返回:
包含估计内存需求的对象。
- 返回类型:
- abstract mutate(G: GraphV2, source_node: int, mutate_relationship_type: str, *, delta: float = 2.0, relationship_weight_property: str | None = None, 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) DeltaSteppingMutateResult¶
运行 Delta Stepping 最短路径算法,并将结果作为新关系存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
delta (float, 默认=2.0) – 用于按暂定距离对节点进行分组的桶宽度。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stats(G: GraphV2, source_node: int, *, delta: float = 2.0, relationship_weight_property: str | None = None, 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) DeltaSteppingStatsResult¶
运行 Delta Stepping 最短路径算法,并返回有关执行的统计信息。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
delta (float, 默认=2.0) – 用于按暂定距离对节点进行分组的桶宽度。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行统计信息的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, *, delta: float = 2.0, relationship_weight_property: str | None = None, 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) DataFrame¶
运行 Delta Stepping 最短路径算法,并以 DataFrame 的形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
delta (float, 默认=2.0) – 用于按暂定距离对节点进行分组的桶宽度。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, source_node: int, write_relationship_type: str, *, delta: float = 2.0, write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) DeltaSteppingWriteResult¶
运行 Delta Stepping 最短路径算法,并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
write_relationship_type (str) – 用于存储结果的关系类型的名称。
delta (float, 默认=2.0) – 用于按暂定距离对节点进行分组的桶宽度。
write_node_ids (bool, 默认=False) – 是否将最短路径的节点 ID 写入关系。
write_costs (bool, 默认=False) – 是否将最短路径的成本写入关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
DeltaSteppingWriteResult – 包含执行元数据的对象。
- 返回类型:
- class graphdatascience.procedure_surface.api.pathfinding.SingleSourceDijkstraEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, *, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估计运行 Dijkstra 最短路径算法的内存需求。
- abstract mutate(G: GraphV2, source_node: int, mutate_relationship_type: str, *, relationship_weight_property: str | None = None, 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) SingleSourceDijkstraMutateResult¶
运行 Dijkstra 最短路径算法,并将结果作为新关系存储在图目录中。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, *, relationship_weight_property: str | None = None, 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) DataFrame¶
运行 Dijkstra 最短路径算法并以 DataFrame 形式返回结果。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, source_node: int, write_relationship_type: str, *, write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) SingleSourceDijkstraWriteResult¶
运行 Dijkstra 最短路径算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
write_relationship_type (str) – 用于存储结果的关系类型的名称。
write_node_ids (bool, 默认=False) – 是否将最短路径的节点 ID 写入关系。
write_costs (bool, 默认=False) – 是否将最短路径的成本写入关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
SingleSourceDijkstraWriteResult – 包含执行元数据的对象。
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.SingleSourceDijkstraMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.SingleSourceDijkstraWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.SourceTargetAStarEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, target_node: int, latitude_property: str, longitude_property: str, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估计运行 A* 最短路径算法所需的内存需求。
- 参数:
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
latitude_property (str) – 存储纬度值的节点属性。
longitude_property (str) – 存储经度值的节点属性。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
- 返回:
包含估计内存需求的对象。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_node: int, latitude_property: str, longitude_property: str, relationship_weight_property: str | None = None, 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) AStarMutateResult¶
运行 A* 最短路径算法并将结果存储为图目录中的新关系。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
latitude_property (str) – 存储纬度值的节点属性。
longitude_property (str) – 存储经度值的节点属性。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_node: int, latitude_property: str, longitude_property: str, relationship_weight_property: str | None = None, 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) DataFrame¶
运行 A* 最短路径算法并将结果作为 DataFrame 返回。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
latitude_property (str) – 存储纬度值的节点属性。
longitude_property (str) – 存储经度值的节点属性。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, source_node: int, target_node: int, latitude_property: str, longitude_property: str, write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) AStarWriteResult¶
运行 A* 最短路径算法并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
latitude_property (str) – 存储纬度值的节点属性。
longitude_property (str) – 存储经度值的节点属性。
write_node_ids (bool, 默认=False) – 是否将最短路径的节点 ID 写入关系。
write_costs (bool, 默认=False) – 是否将最短路径的成本写入关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
AStarWriteResult – 包含执行元数据的对象。
- 返回类型:
- class graphdatascience.procedure_surface.api.pathfinding.SourceTargetDijkstraEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算从源节点到一个或多个目标节点运行 Dijkstra 最短路径算法的内存需求。
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, 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) DijkstraMutateResult¶
运行从源节点到一个或多个目标节点的 Dijkstra 最短路径算法,并将结果存储为图目录中的新关系。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_nodes: int | list[int], relationship_weight_property: str | None = None, 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) DataFrame¶
运行从源节点到一个或多个目标节点的 Dijkstra 最短路径算法,并将结果作为 DataFrame 返回。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, source_node: int, target_nodes: int | list[int], write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) DijkstraWriteResult¶
运行从源节点到一个或多个目标节点的 Dijkstra 最短路径算法,并将结果写回数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
source_node (int) – 用作起点的节点 ID。
write_node_ids (bool, default=False) – 是否将最短路径的节点 ID 写入关系中。
write_costs (bool, default=False) – 是否将最短路径的成本写入关系中。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
DijkstraWriteResult – 包含执行元数据的对象。
- 返回类型:
DijkstraWriteResult
- class graphdatascience.procedure_surface.api.pathfinding.SourceTargetYensEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, target_node: int, k: int, relationship_weight_property: str | None = None, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算运行 Yen 的 K 条最短路径算法的内存需求。
Yen 算法计算从源节点到目标节点的 K 条最短路径。
- 参数:
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
k (int) – 要查找的最短路径数量。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
- 返回:
包含估计内存需求的对象。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_relationship_type: str, source_node: int, target_node: int, k: int, relationship_weight_property: str | None = None, 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) YensMutateResult¶
运行 Yen 的 K 条最短路径算法并将结果存储为图目录中的新关系。
Yen 算法计算从源节点到目标节点的 K 条最短路径。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
k (int) – 要查找的最短路径数量。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含执行元数据的对象。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_node: int, k: int, relationship_weight_property: str | None = None, 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) DataFrame¶
运行 Yen 的 K 条最短路径算法并将结果作为 DataFrame 返回。
Yen 算法计算从源节点到目标节点的 K 条最短路径。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
k (int) – 要查找的最短路径数量。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
最短路径结果作为一个 DataFrame,包含 sourceNode、targetNode、totalCost、nodeIds、costs 和 index 列。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, source_node: int, target_node: int, k: int, write_node_ids: bool = False, write_costs: bool = False, relationship_weight_property: str | None = None, 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) YensWriteResult¶
运行 Yen 的 K 最短路径算法并将结果写回数据库。
Yen 算法计算从源节点到目标节点的 K 条最短路径。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
source_node (int) – 用作起点的节点 ID。
target_node (int) – 最短路径计算的目标节点。
k (int) – 要查找的最短路径数量。
write_node_ids (bool, 默认=False) – 是否将最短路径的节点 ID 写入关系。
write_costs (bool, 默认=False) – 是否将最短路径的成本写入关系。
relationship_weight_property (str | None) – 用作权重的属性名称。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
YensWriteResult – 包含执行元数据的对象。
- 返回类型:
- class graphdatascience.procedure_surface.api.pathfinding.SpanningTreeEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算运行生成树 (Spanning tree) 算法所需的内存需求。
- 参数:
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
- 返回:
内存估算结果,包括所需的字节数和百分比。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_relationship_type: str, mutate_property: str, source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', 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) SpanningTreeMutateResult¶
运行生成树算法,并将结果作为新关系添加到内存图表中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
mutate_property (str) – 用于存储结果的节点属性名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含统计信息和计时信息的运行结果。
- 返回类型:
- abstract stats(G: GraphV2, source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', 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) SpanningTreeStatsResult¶
以统计模式运行生成树算法,返回统计信息而不修改图表。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
有关计算出的生成树的统计信息。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', 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) DataFrame¶
运行生成树算法,并将结果作为 DataFrame 返回。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含计算出的生成树中各边的 DataFrame。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, write_property: str, source_node: int, relationship_weight_property: str | None = None, objective: str = 'minimum', 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) SpanningTreeWriteResult¶
运行生成树算法,并将结果写回 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
write_property (str) – 用于存储结果的节点属性名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
objective (str, 默认值="minimum") – 要优化的目标函数。可选择“minimum”(最小)或“maximum”(最大)。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
SpanningTreeWriteResult – 包含统计信息和计时结果。
- 返回类型:
- pydantic model graphdatascience.procedure_surface.api.pathfinding.SpanningTreeMutateResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.SpanningTreeStatsResult¶
- pydantic model graphdatascience.procedure_surface.api.pathfinding.SpanningTreeWriteResult¶
- class graphdatascience.procedure_surface.api.pathfinding.SteinerTreeEndpoints¶
- abstract estimate(G: GraphV2 | dict[str, Any], source_node: int, target_nodes: list[int], relationship_weight_property: str | None = None, delta: float = 2.0, apply_rerouting: bool = False, relationship_types: list[str] = ['*'], node_labels: list[str] = ['*'], sudo: bool = False, username: str | None = None, concurrency: int | None = None) EstimationResult¶
估算运行斯坦纳树 (Steiner tree) 算法所需的内存需求。
- 参数:
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
delta (float, 默认=2.0) – 最短路径计算的 delta 参数。
apply_rerouting (bool, 默认=False) – 是否应用重路由优化。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
- 返回:
内存估算结果,包括所需的字节数和百分比。
- 返回类型:
- abstract mutate(G: GraphV2, mutate_relationship_type: str, mutate_property: str, source_node: int, target_nodes: list[int], relationship_weight_property: str | None = None, delta: float = 2.0, apply_rerouting: bool = False, 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) SteinerTreeMutateResult¶
运行斯坦纳树算法,并将结果作为新关系添加到内存图表中。
- 参数:
G (GraphV2) – 要使用的图对象
mutate_relationship_type (str) – 用于存储结果的关系类型名称。
mutate_property (str) – 用于存储结果的节点属性名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
delta (float, 默认=2.0) – 内部使用的最短路径计算的 delta 参数。
apply_rerouting (bool, 默认=False) – 是否应用重路由优化以改进树结构。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含统计信息和计时信息的运行结果。
- 返回类型:
- abstract stats(G: GraphV2, source_node: int, target_nodes: list[int], relationship_weight_property: str | None = None, delta: float = 2.0, apply_rerouting: bool = False, 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) SteinerTreeStatsResult¶
以统计模式运行斯坦纳树算法,返回统计信息而不修改图表。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
delta (float, 默认=2.0) – 内部使用的最短路径计算的 delta 参数。
apply_rerouting (bool, 默认=False) – 是否应用重路由优化以改进树结构。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
有关计算出的斯坦纳树的统计信息。
- 返回类型:
- abstract stream(G: GraphV2, source_node: int, target_nodes: list[int], relationship_weight_property: str | None = None, delta: float = 2.0, apply_rerouting: bool = False, 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) DataFrame¶
运行斯坦纳树算法,并将结果作为 DataFrame 返回。
- 参数:
G (GraphV2) – 要使用的图对象
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
delta (float, 默认=2.0) – 内部使用的最短路径计算的 delta 参数。
apply_rerouting (bool, 默认=False) – 是否应用重路由优化以改进树结构。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
- 返回:
包含计算出的斯坦纳树中各边的 DataFrame。
- 返回类型:
DataFrame
- abstract write(G: GraphV2, write_relationship_type: str, write_property: str, source_node: int, target_nodes: list[int], relationship_weight_property: str | None = None, delta: float = 2.0, apply_rerouting: bool = False, 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) SteinerTreeWriteResult¶
运行 Steiner 树算法并将结果写回 Neo4j 数据库。
- 参数:
G (GraphV2) – 要使用的图对象
write_relationship_type (str) – 用于存储结果的关系类型的名称。
write_property (str) – 用于存储结果的节点属性名称。
source_node (int) – 用作起点的节点 ID。
relationship_weight_property (str | None) – 用作权重的属性名称。
delta (float, 默认=2.0) – 内部使用的最短路径计算的 delta 参数。
apply_rerouting (bool, 默认=False) – 是否应用重路由优化以改进树结构。
relationship_types (list[str]) – 使用给定的关系类型过滤图。将包含具有任何给定类型的关系。
sudo (bool) – 禁用内存保护。
log_progress (bool) – 显示进度日志。
username (str | None) – 作为管理员,模拟其他用户以访问其图。
concurrency (int | None) – 要使用的并发线程数。
job_id (str | None) – 计算任务的标识符。
write_concurrency (int | None) – 用于写入的并发线程数。返回
-------
SteinerTreeWriteResult – 包含统计信息和计时信息的运行结果。
- 返回类型:
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.SteinerTreeMutateResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.SteinerTreeStatsResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.SteinerTreeWriteResult¶
- pydantic 模型 graphdatascience.procedure_surface.api.pathfinding.YensMutateResult¶