Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Hungarian Algorithm Matching in Power Query?

Hi - I am trying to use power query to create the most optimal matches in a dataset. Think of it as the college dorm assigment problem. I have survey responses from a group of people and I want to match individuals with the most opposite responses. The issue is rather than create a unique score for each person, the individual's responses are compared to every other person to create a score for every possible pairing. I have been able to create a matrix with the participants on the X and Y axis and their pairing score. Now I need to select the pairings with the highest scores, without any of the participants being selected more than once. 

 

After some digging, it appears to be a perfect use case for the hungarian aglorithm, does anyone know how to do this in Power Query, or maybe have the Python code to do it?       

 

Thanks in advance

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

 Hi @Anonymous ,

About Hungarian Algorithm in python, I think you could refer these two simliar articles which introduce it in details:

  1. The basic principle of Hungarian algorithm and its implementation in Python 
  2. Hungarian Algorithm 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@v-yingjl those are great links, thank you! 

v-yingjl
Community Support
Community Support

 Hi @Anonymous ,

About Hungarian Algorithm in python, I think you could refer these two simliar articles which introduce it in details:

  1. The basic principle of Hungarian algorithm and its implementation in Python 
  2. Hungarian Algorithm 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors