Skip to content

Commit b73f29f

Browse files
committed
Use sparse sidecar for unweighted shortest path
1 parent 1f82157 commit b73f29f

3 files changed

Lines changed: 764 additions & 17 deletions

File tree

src/dsl/graph/exec_path.rs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use neb::dovahkiin::expr::serde::Expr;
77
use neb::ram::types::Id;
88

99
use crate::dsl::exec_helpers::distributed_directions_for_edge_schemas;
10+
use crate::dsl::graph::exec_path_sparse::try_execute_sparse_sidecar_shortest_path;
1011
use crate::dsl::graph::json::{PathsResult, ShortestPathResult};
1112
use crate::dsl::graph::path_materialize::{
1213
build_path_edges, fetch_vertices, materialize_expand_edges,
@@ -188,23 +189,30 @@ pub async fn execute_path(
188189
)
189190
.await?
190191
} else {
191-
info!(
192-
"dsl path executor: unweighted path using gas_bidirectional_bfs_with_parent (all_candidates={})",
193-
query.all_candidates
194-
);
195-
gas_bidirectional_bfs_with_parent(
196-
&runtime.compute_coordinator(),
197-
runtime.server_id(),
198-
&from_ids,
199-
&to_ids,
200-
&query.edge_schema_ids,
201-
&direction_variants,
202-
query.max_depth as u32,
203-
query.max_visited,
204-
query.vertex_filter.clone(),
205-
query.edge_filter.clone(),
206-
)
207-
.await?
192+
match try_execute_sparse_sidecar_shortest_path(runtime, &query, &from_ids, &to_ids)
193+
.await?
194+
{
195+
Some(result) => result,
196+
None => {
197+
info!(
198+
"dsl path executor: unweighted path using gas_bidirectional_bfs_with_parent (all_candidates={})",
199+
query.all_candidates
200+
);
201+
gas_bidirectional_bfs_with_parent(
202+
&runtime.compute_coordinator(),
203+
runtime.server_id(),
204+
&from_ids,
205+
&to_ids,
206+
&query.edge_schema_ids,
207+
&direction_variants,
208+
query.max_depth as u32,
209+
query.max_visited,
210+
query.vertex_filter.clone(),
211+
query.edge_filter.clone(),
212+
)
213+
.await?
214+
}
215+
}
208216
}
209217
};
210218

0 commit comments

Comments
 (0)