pub struct VF3Query<'a> { /* private fields */ }Expand description
Builder for configuring and executing VF3 subgraph isomorphism queries.
Provides a fluent API for setting options and choosing algorithm variants.
§Examples
use vf3lib_rs::VF3Query;
// Simple usage with default settings
let result = VF3Query::new("pattern.grf", "target.grf")
.run()?;
// Edge-induced matching with VF3L variant
let result = VF3Query::new("pattern.grf", "target.grf")
.edge_induced()
.undirected()
.run_light()?;
// Parallel execution with custom thread count
let result = VF3Query::new("pattern.grf", "target.grf")
.with_threads(4)
.run_parallel()?;Implementations§
Source§impl<'a> VF3Query<'a>
impl<'a> VF3Query<'a>
Sourcepub fn new(pattern: &'a str, target: &'a str) -> Self
pub fn new(pattern: &'a str, target: &'a str) -> Self
Create a new query with the given pattern and target graph files.
Sourcepub fn format(self, format: GraphFormat) -> Self
pub fn format(self, format: GraphFormat) -> Self
Set the graph file format.
Sourcepub fn undirected(self) -> Self
pub fn undirected(self) -> Self
Treat graphs as undirected.
Sourcepub fn edge_induced(self) -> Self
pub fn edge_induced(self) -> Self
Use edge-induced isomorphism (monomorphism) instead of node-induced.
Sourcepub fn node_induced(self) -> Self
pub fn node_induced(self) -> Self
Use node-induced isomorphism (default).
Sourcepub fn store_solutions(self) -> Self
pub fn store_solutions(self) -> Self
Store all solution mappings in memory.
Warning: This may use significant memory for large result sets.
Sourcepub fn first_only(self) -> Self
pub fn first_only(self) -> Self
Stop after finding the first solution (sequential algorithms only).
Sourcepub fn repetition_time_limit(self, seconds: f32) -> Self
pub fn repetition_time_limit(self, seconds: f32) -> Self
Set minimum execution time in seconds for averaging multiple runs.
Sourcepub fn with_threads(self, num_threads: i16) -> Self
pub fn with_threads(self, num_threads: i16) -> Self
Set the number of worker threads for parallel execution.
Sourcepub fn parallel_algorithm(self, algo: i8) -> Self
pub fn parallel_algorithm(self, algo: i8) -> Self
Set the parallel algorithm variant.
1- GSS (Global State Stack)2- WLS (Work-stealing with Local Stack)
Sourcepub fn run(self) -> Result<ResultData, VF3Error>
pub fn run(self) -> Result<ResultData, VF3Error>
Run the VF3 algorithm with full heuristics.
Best suited for medium to large dense graphs.
§Errors
Returns VF3Error::ExecutionFailed if the algorithm fails.
Sourcepub fn run_light(self) -> Result<ResultData, VF3Error>
pub fn run_light(self) -> Result<ResultData, VF3Error>
Run the VF3L lightweight variant without look-ahead heuristic.
Best suited for small or sparse graphs.
§Errors
Returns VF3Error::ExecutionFailed if the algorithm fails.
Sourcepub fn run_parallel(self) -> Result<ResultData, VF3Error>
pub fn run_parallel(self) -> Result<ResultData, VF3Error>
Run the VF3P parallel variant with multi-threading support.
Best suited for computationally hard instances.
§Errors
Returns VF3Error::ExecutionFailed if the algorithm fails.