aboutsummaryrefslogtreecommitdiff
path: root/src/tsp_approx.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tsp_approx.rs')
-rw-r--r--src/tsp_approx.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tsp_approx.rs b/src/tsp_approx.rs
index 097fee7..4484b91 100644
--- a/src/tsp_approx.rs
+++ b/src/tsp_approx.rs
@@ -403,6 +403,12 @@ pub(crate) fn tsp<M>(
where
M: MetricElem,
{
+ match embeds.len() {
+ 0 => return (vec![], 0.0),
+ 1 => return (vec![0], 0.0),
+ _ => (),
+ }
+
let bar = ProgressBar::new_spinner();
bar.set_style(ProgressStyle::with_template("{spinner} {msg}").unwrap());
bar.enable_steady_tick(std::time::Duration::from_millis(100));