### Rearrange point-pairs list with "closest pairs" algorithm

Auteur | 2 Utilisateurs souscrits | |
---|---|

Francesco Vitale |
Hi all, |

Juin 22, 2018 à 17:59 #26839 | |

Francesco Vitale |
To avoid much confusion, I’ll try to restate my purpose in a different way, hoping to make it clearer: what I’m looking for is a code that finds the closest point to a starting point (e.g. the first one in the original list from point-pairs), then takes the found one and repeat the search of closest one, rearranging the original list in the new found order. That would be a sorting loop that starts from a point, finds the nearest one, then takes the latter, finds the nearest and so on… Any help or suggestion is greatly appreciated. |

Juin 27, 2018 à 18:08 #26870 | |

JialinLiu |
Hey Francesco, I have some similar functions and have tried to combine them together. It that what you mean? (in-package :om) (defmethod distance-2-points ((pair-a list) (pair-b list)) (defun sort-list-nearst-cadr (num comb-lst) (defun sort-point-list-nearst (first-point other-point) (defun point-closest-tree (point-lst) (point-closest-tree ‘((0 0) (3 5) (4 5) (5 3) (3 7) (9 9) (10 10) (10 10.1) (9.99 10.0))) ; result ===> ((0 0) (3 5) (4 5) (3 7) (5 3) (9 9) (9.99 10.0) (10 10) (10 10.1)) Best, |

Juin 27, 2018 à 23:52 #26883 | |

Francesco Vitale |
Dear Jialin, ## Attachments: |

Juin 28, 2018 à 11:01 #26894 | |

JialinLiu |
Hi Francesco, I could not get your omp file, it seems to be blank. Best, ## Attachments: |

Juin 28, 2018 à 12:23 #26903 | |

Francesco Vitale |
Dear Jialin, |

Juin 28, 2018 à 12:52 #26910 | |

Francesco Vitale |
Dear Jialin, |

Juin 28, 2018 à 12:53 #26913 | |

Francesco Vitale |
Ok Jialin, |

Juin 28, 2018 à 13:02 #26916 | |

JialinLiu |
Hi Francesco, you are welcome! This kind of sortation is what I am working with now (to organize the instrumental gesture and so on), have fun with that! Best, |

Juin 29, 2018 à 06:11 #26921 | |

Francesco Vitale |
Hi Jialin, |

Juin 29, 2018 à 09:37 #26922 |

Vous devez être connecté pour répondre à ce sujet.