MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / hamiltonian_cycle_util

Method hamiltonian_cycle_util

src/backtracking/hamiltonian_cycle.rs:90–114  ·  view source on GitHub ↗

Recursively searches for a Hamiltonian cycle. This function is called by `find_hamiltonian_cycle`. # Arguments `path` - A mutable vector representing the current path being explored. `visited` - A mutable vector representing the visited vertices. `pos` - The position of the current vertex being considered. # Returns `true` if a Hamiltonian cycle is found, `false` otherwise.

(
        &self,
        path: &mut [Option<usize>],
        visited: &mut [bool],
        pos: usize,
    )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

Calls 2

num_verticesMethod · 0.45
is_safeMethod · 0.45

Tested by

no test coverage detected