VF3Query

Struct VF3Query 

Source
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>

Source

pub fn new(pattern: &'a str, target: &'a str) -> Self

Create a new query with the given pattern and target graph files.

Source

pub fn format(self, format: GraphFormat) -> Self

Set the graph file format.

Source

pub fn undirected(self) -> Self

Treat graphs as undirected.

Source

pub fn directed(self) -> Self

Treat graphs as directed (default).

Source

pub fn edge_induced(self) -> Self

Use edge-induced isomorphism (monomorphism) instead of node-induced.

Source

pub fn node_induced(self) -> Self

Use node-induced isomorphism (default).

Source

pub fn store_solutions(self) -> Self

Store all solution mappings in memory.

Warning: This may use significant memory for large result sets.

Source

pub fn first_only(self) -> Self

Stop after finding the first solution (sequential algorithms only).

Source

pub fn verbose(self) -> Self

Enable verbose output.

Source

pub fn repetition_time_limit(self, seconds: f32) -> Self

Set minimum execution time in seconds for averaging multiple runs.

Source

pub fn with_threads(self, num_threads: i16) -> Self

Set the number of worker threads for parallel execution.

Source

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)
Source

pub fn lock_free(self) -> Self

Enable lock-free stack implementation for parallel execution.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for VF3Query<'a>

§

impl<'a> RefUnwindSafe for VF3Query<'a>

§

impl<'a> Send for VF3Query<'a>

§

impl<'a> Sync for VF3Query<'a>

§

impl<'a> Unpin for VF3Query<'a>

§

impl<'a> UnwindSafe for VF3Query<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.