Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

Delta-stepping single source shortest path (SSSP) algorithm

フォーカスモード
Delta-stepping single source shortest path (SSSP) algorithm - Neptune Analytics
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

The .sssp.deltaStepping algorithm computes the shortest path distances from a single source vertex to all other vertices in the graph using a delta-stepping algorithm.

Neptune Analytics implements the algorithm such that:

  • Positive edge weights must be provided using the edgeWeightProperty field

  • Negative edge weights are not supported.

  • The traversal direction cannot be set to both.

.sssp.deltaStepping   syntax

CALL neptune.algo.sssp.deltaStepping( [source-node list (required)], { edgeWeightProperty: edge weight predicate for traversal (required) edgeWeightType: numeric type of the edge weight property (required) delta: the stepping delta (optional) edgeLabels: [list of edge labels for filtering (optional)], vertexLabel: a node label for filtering (optional), traversalDirection: traversal direction (optional), concurrency: number of threads to use (optional) } ) YIELD the outputs to generate (source and/or node) RETURN the outputs to return

.sssp.deltaStepping   inputs

  • a source node list   (required)   –   type: Node[] or NodeId[];   default: none.

    The node or nodes to use as the starting location(s) for the algorithm.

    • Each starting node triggers its own execution of the algorithm.

    • If the source-node list is empty then the query result is also empty.

    • If the algorithm is called following a MATCH clause (this is known as query-algorithm integration), the output of the MATCH clause is used as the source-node list for the algorithm.

  • a configuration object that contains:
    • edgeWeightProperty (required)   –   type: string;   default: none.

      The edge weight predicate for traversal.

    • edgeWeightType (required)   –   type: string;   valid values: "int", "long", "float", "double".

      The numeric data type of the values in the property specified by edgeWeightProperty.

    • delta   (optional)   –   type: float;   example: 3.0;   default: 2.0.

      The delta stepping value.

    • edgeLabels   (optional)   –   type: a list of edge label strings;   example: ["route", ...];   default: no edge filtering.

      To filter on one more edge labels, provide a list of the ones to filter on. If no edgeLabels field is provided then all edge labels are processed during traversal.

    • vertexLabel   (optional)   –   type: string;   example: "airport";  default: no node filtering.

      A node label for node filtering. If a node label is provided, vertices matching the label are the only vertices that are included, including vertices in the input list.

    • traversalDirection (optional)   –   type: string;   default: "outbound".

      The direction of edge to follow. Must be one of: "inbound" or "outbound".

    • concurrency   (optional)   –   type: 0 or 1;   default: 0.

      Controls the number of concurrent threads used to run the algorithm.

      If set to 0, uses all available threads to complete execution of the individual algorithm invocation. If set to 1, uses a single thread. This can be useful when requiring the invocation of many algorithms concurrently.

Outputs for the sssp.deltaStepping algorithm

For every node that can be reached from the specified source list, the algorithm returns:

  • source   –   The source node.

  • node   –   A node found traversing from the source.

  • distance   –   The distance between the source node and the found node.

.sssp.deltaStepping   query examples

This is a standalone query, where a source node (or nodes) is explicitly provided:

CALL neptune.algo.sssp.deltaStepping( ["101"], { edgeLabels: ["route"], edgeWeightProperty: "dist", edgeWeightType: "int" } )

This is a query integration example, where where .sssp.deltaStepping follows a MATCH clause and uses the output of the MATCH clause as its source node list:

MATCH (source:airport {code: 'ANC'}) CALL neptune.algo.sssp.deltaStepping( source, { edgeLabels: ["route"], edgeWeightProperty: "dist", edgeWeightType: "int", vertexLabel: "airport", traversalDirection: "outbound", concurrency: 1 } ) YIELD node, parent, distance RETURN source, node, parent, distance
Warning

It is not good practice to use MATCH(n) without restriction in query integrations. Keep in mind that every node returned by the MATCH(n) clause invokes the algorithm once, which can result a very long-running query if a large number of nodes is returned. Use LIMIT or put conditions on the MATCH clause to restrict its output appropriately.

Sample   .sssp.deltaStepping   output

Here is an example of the output returned by .sssp.deltaStepping when run against the sample air-routes dataset [nodes], and sample air-routes dataset [edges], when using the following query:

aws neptune-graph execute-query \ --graph-identifier ${graphIdentifier} \ --query-string "CALL neptune.algo.sssp.deltaStepping(['101'], {edgeWeightProperty: 'dist', edgeWeightType: 'int'}) yield source, node, distance return source, node, distance limit 2" \ --language open_cypher \ /tmp/out.txt cat /tmp/out.txt { "results": [ { "source": { "~id": "101", "~entityType": "node", "~labels": ["airport"], "~properties": { "lat": 13.6810998916626, "elev": 5, "longest": 13123, "city": "Bangkok", "type": "airport", "region": "TH-10", "desc": "Suvarnabhumi Bangkok International Airport", "code": "BKK", "prscore": 0.002498496090993285, "degree": 308, "lon": 100.747001647949, "wccid": 2357352929951779, "country": "TH", "icao": "VTBS", "runways": 2 } }, "node": { "~id": "2709", "~entityType": "node", "~labels": ["airport"], "~properties": { "lat": 65.4809036254883, "elev": 49, "longest": 8711, "city": "Nadym", "type": "airport", "region": "RU-YAN", "desc": "Nadym Airport", "code": "NYM", "prscore": 0.00016044313088059425, "degree": 18, "lon": 72.6988983154297, "wccid": 2357352929951779, "country": "RU", "icao": "USMM", "runways": 1 } }, "distance": 3812 }, { "source": { "~id": "101", "~entityType": "node", "~labels": ["airport"], "~properties": { "lat": 13.6810998916626, "elev": 5, "longest": 13123, "city": "Bangkok", "type": "airport", "region": "TH-10", "desc": "Suvarnabhumi Bangkok International Airport", "code": "BKK", "prscore": 0.002498496090993285, "degree": 308, "lon": 100.747001647949, "wccid": 2357352929951779, "country": "TH", "icao": "VTBS", "runways": 2 } }, "node": { "~id": "2667", "~entityType": "node", "~labels": ["airport"], "~properties": { "lat": 56.8567008972168, "elev": 2188, "longest": 6562, "city": "Ust-Kut", "type": "airport", "region": "RU-IRK", "desc": "Ust-Kut Airport", "code": "UKX", "prscore": 0.000058275499999999997, "degree": 4, "lon": 105.730003356934, "wccid": 2357352929951779, "country": "RU", "icao": "UITT", "runways": 1 } }, "distance": 2993 } ] }

このページの内容

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.