matsengrp / historydag

https://matsengrp.github.io/historydag
GNU General Public License v3.0
0 stars 1 forks source link

Implement sum pairwise rf distance #52

Closed willdumm closed 1 year ago

willdumm commented 1 year ago

This PR adds methods HistoryDag.sum_rf_distances and HistoryDag.average_pairwise_rf_distance, which compute the sum of rooted RF distances over all pairs of histories in a DAG, or between two DAGs.

Also added, a method HistoryDag.history_intersect which trims the DAG to contain only the histories which are also in a passed reference DAG. This method can be run using the & operator.