A general and efficient representation of ancestral recombination graphs Preprint in bioRxiv (November 2023)