There is no feature to do this in Hugin. You could maybe try
something like setting all photos to roll, pitch and yaw = 0,
optimising, then the unconnected photos will still have these 0
values so they can be identified and deleted.
If you need to do this lots of times, then it would be possible with
Panotools::Script. You would need to write a perl script that
identifies the connected groups with the ConnectedGroups() method,
sorts the list to find the biggest group, then creates a new .pto
project of just the photos in this group using the Subset() method.
--
Bruno