Matching with constraints

一世执手 提交于 2019-12-06 02:08:32

Essentially your problem is well-known assignment problem:

Consider a bipartite graph where each side has all persons as nodes (yes, each person will appear twice: once at the left side and once at the right one). Then you can add an edge from person A from the left side to the right side's person B if A is allowed to send a gift to B. Then you can apply, for example, Hungarian algorithm to find assignment which maximizes number of allowed gifts.

Sounds like constraint Satisfaction problem. There is a graphical representation for the problem, that shows visually how it is solved. I took a course on AI that talked about it. Here is a lecture slides: Lecture. Slide 15 shows the picture. Read through the slides, there are several algorithms that solve CSP, including Variable Elimitation ( slide 44).


易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!