Skip to content

Commit

Permalink
Merge pull request #1374 from YuliaProkopovych/opt-tools-fix
Browse files Browse the repository at this point in the history
NOT READY(optimization_tools): Fix publishing
  • Loading branch information
Wandalen authored Jun 6, 2024
2 parents a067841 + 0d8c21d commit 957076e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,21 @@ pub struct Edge( NodeIndex, NodeIndex, EdgeWeight );

impl Edge
{
/// Create new Edge
pub fn new( node1 : NodeIndex, node2 : NodeIndex, weight : EdgeWeight ) -> Self
{
Edge( node1, node2, weight )
}
/// Get weight of the edge.
pub fn weight( &self ) -> EdgeWeight
{
self.2
}
/// Get nodes of the edge
pub fn nodes( &self ) -> ( NodeIndex, NodeIndex )
{
( self.0, self.1 )
}
}

impl Graph for TSPGraph
Expand All @@ -127,7 +137,7 @@ impl Graph for TSPGraph
{
if let Some( ( _, weight ) ) = node_vec.iter().find( | ( n, _ ) | n == node2 )
{
return Some( Edge( *node1, *node2, *weight ) );
return Some( Edge::new( *node1, *node2, *weight ) );
}
}
None
Expand Down
1 change: 0 additions & 1 deletion module/move/optimization_tools/tests/optimization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ fn solve_with_sa()
000000013
"#;

let seed : Seed = "seed3".into();
let initial = SudokuInitial::new( Board::from( input ) );
let problem = Problem::new( initial, BestRowsColumnsCrossover, RandomPairInBlockMutation );
let optimizer = HybridOptimizer::new( Config::default(), problem );
Expand Down

0 comments on commit 957076e

Please sign in to comment.