aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md12
-rw-r--r--src/main.rs2
2 files changed, 10 insertions, 4 deletions
diff --git a/README.md b/README.md
index 29997ae..3c9b633 100644
--- a/README.md
+++ b/README.md
@@ -14,17 +14,23 @@ Arguments:
[IMAGES]...
Options:
- -e, --embedder <EMBEDDER> Characteristic to sort by [default: content-euclidean] [possible values: brightness, hue, color, content-euclidean, content-angular-distance, content-manhatten]
+ -e, --embedder <EMBEDDER> Characteristic to sort by [default: content-angular-distance] [possible values: brightness, hue, color, content-euclidean, content-angular-distance, content-manhatten]
-s, --symlink-dir <SYMLINK_DIR> Symlink the sorted images into this directory
-o, --copy-dir <COPY_DIR> Copy the sorted images into this directory. Uses COW when available
-c, --stdout Write sorted paths into stdout, one per line
-0, --stdout0 Write sorted paths into stdout, null-separated. Overrides -c
-b, --benchmark Output total tour length to stderr
- --tsp-approx <TSP_APPROX> Algorithm for TSP approximation. Leave as default if unsure [default: christofides] [possible values: mst-dfs, christofides, christofides-refined]
+ --tsp-approx <TSP_APPROX> Algorithm for TSP approximation. Leave as default if unsure [default: christofides] [possible values: mst-dfs, christofides]
+ -r <REFINE> Number of 2-Opt refinement steps. Has quickly diminishing returns [default: 3]
+ -i, --ignore-errors Ignore failed embeddings
+ --hash-seed <HASH_SEED> Seed for hashing. Random by default
-h, --help Print help
```
## Insides
The chrisofides implementation uses an approximated min-weight matching algorithm, which may be non-ideal, though I haven't benchmarked how much of a difference it makes (mainly due to the implementation complexity of an exact algorithm, which would also increase the implementations complexity from O(n²) to O(n³) where n is the number of given images).
-christofides-refined is planned to be christofides but with an O(n²) 2-opt-swapping step added after the main algorithm. Implementing this efficiently will also require some algorithmic trickery, so it's not ready yet.
+The 2-Opt refinement algorithm uses a doubly linked list with implicit iteration order to be able to do 2-Opt swaps in O(n), bringing a 2-Opt iteration to O(n²) complexity.
+
+## Compatibility
+`embeddings-sort` has, at some point, worked on both linux and windows.
diff --git a/src/main.rs b/src/main.rs
index f01804c..0318210 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -69,7 +69,7 @@ struct Args {
refine: usize,
/// Ignore failed embeddings
- #[arg(short = 'i')]
+ #[arg(short = 'i', long)]
ignore_errors: bool,
/// Seed for hashing. Random by default.