A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.
2 of 2 added 4 characters in body

You need to sort origin and destination first, to make the pairs with the same end points equal. As it's only two columns, you can do that in a CASE ... END here. Then you can GROUP BY these and get the count(*).

 SELECT CASE 
          WHEN origin <= destination
            THEN origin
          ELSE
            destination
        END,
        CASE 
          WHEN destination >= origin
            THEN destination
          ELSE
            origin
        END,
        count(*)
        FROM routes
        GROUP BY CASE 
                   WHEN origin <= destination
                     THEN origin
                   ELSE
                     destination
                 END,
                 CASE 
                   WHEN destination >= origin
                     THEN destination
                   ELSE
                     origin
                 END;