Instead of doing this, maybe extend Origin class with a private static inner class here that has an additional score field.  For each path that scores above the threshold, create an instance of this subclass, put the score into it, and push that into a collection.

If we want a cap on the number of items we keep in the collection (I think here you want the two highest scoring paths yes?) then just use a TreeSet with a custom Comparator that knows how to look at that score field.  If the size of the set after adding the new Origin is larger than the threshold, remove the smallest item from the set.  Usually I hate using JRE collections classes in performance critical code, but here its a TreeSet of just 2-3 items.  Its not that bad.