Minimum Scalar Product
Jelly, 6 bytes
ṢṚ×Ṣ}S
Try it online!
Using brute force is equally short:
Œ!×S€Ṃ
How it works
ṢṚ×Ṣ}S Main link. Arguments: u (vector), v (vector)
Ṣ Sort the components of u.
Ṛ Reverse.
Ṣ} Sort the components of v.
× Multiply the results, element by element.
S Compute the sum of the products.
Seriously, 6 bytes
,SR,S*
Try it online!
Explanation:
,SR,S*
,SR input first vector, sort, reverse
,S input second vector, sort
* dot product
APL, 15 bytes
{+/⍺[⍒⍺]×⍵[⍋⍵]}
This is a dyadic function that accepts arrays on the left and right and returns an integer. It uses the same approach as my Julia answer: dot product of the sorted arrays, one descending and one ascending.
Try it here