For example two arrays:
var names = ['Tom','Jerry','Sam'];
var hobbies = ['Eat','Sleep','Laugh'];
Is there a function can construct the two arrays as maps like:
{'Tome':'Eat','Jerry':'Sleep','Sam':'Laugh'}
{'Tome':'Sleep','Jerry':'Eat','Sam':'Laugh'}
{'Tome':'Laugh','Jerry':'Eat','Sam':'Laugh'}
and other 3 more... Totally as given the two arrays the returned maps number should be A33 = 6. By javascript or python any can do it. Any ideas?
After searching from web, this is an assignment problem and the way to resolve it is called Hungarian Method. Now I am looking for a Hungarian Algorithm implementation by javascript or python.