Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOT READY(optimization_tools): Fix publishing #1374

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading