/Engine/Source/Runtime/Experimental/Chaos/Public/Chaos/Collision/ParticleCollisions.h
In a mostly stationary scene the choice of container doesn't matter much. In a highly dynamic scene it matters a lot. This was tested withTMap,TSortedMap, andTArray.TArraywas better in all cases. We store the list of overlapping particle pairs for every particle. This list can get quite large for world objects. We need to make sure that Add / Remove are not O(N). We also search this list to find an existing MidPhase for a specific particle pair. However we always search the particle with the fewest overlaps, which will be a dynamic particle that should not have too many contacts.
typedef [TArray](API\Runtime\Core\Containers\TArray)< TPair< uint64, [FParticlePairMidPhase](API\Runtime\Chaos\Chaos\Collision\FParticlePairMidPhase) * >> FContainerType