From d4e489eafa93eb41cb2bfdc9bca56dd56fc9340a Mon Sep 17 00:00:00 2001 From: Kamen Mladenov Date: Fri, 10 Jan 2025 10:29:41 +0200 Subject: feat(guests/graph_coloring): Make codebase more flexible --- guests/graph_coloring/src/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'guests') diff --git a/guests/graph_coloring/src/lib.rs b/guests/graph_coloring/src/lib.rs index 2feef7f..691a127 100644 --- a/guests/graph_coloring/src/lib.rs +++ b/guests/graph_coloring/src/lib.rs @@ -1,7 +1,5 @@ -const VERTICES: usize = 010; - #[guests_macro::proving_entrypoint] -pub fn start( +pub fn main( graph: Vec>, colors: u32, coloring: Vec>, @@ -17,8 +15,8 @@ pub fn start( let mut ret = max_color + 1 == colors; // Is coloring correct? - for i in 0..VERTICES { - for j in 0..VERTICES { + for i in 0..graph.len() { + for j in 0..graph.len() { // graph[i][j] -> coloring[i] != coloring[j] ret = ret & (! graph[i][j] | (coloring[i][1] != coloring[j][1])); } -- cgit v1.2.3