Yesterday simulation, there is a high-dimensional universe, two-figure matching is the positive solution, but the two-figure matching a little forget, review.
Binary graph matching is actually a case where there are two sets of elements that can match to try to find the most matches.
Two of the binary graphs can be connected with an array to achieve.
Each element can be connected to the edge, if you want to match the point has been accounted for, let the front and target point matching point to find another can match the point, so that you can connect as many points as possible.
The specific code is as follows:
1 BOOLFind (ll x)2 {3 for(intI=1; i<=numb; i++)//iterate through all the points in another collection4 {5 if(Vis[i] = =0and Mp[x][i])//if a point in another collection has not been traversed, and the two points can match6 {7Vis[i] =1;//Mark8 if(Pri[i] = =0|| Find (Pri[i]))//if the target match point does not match, or a point that has already been matched can be swapped for another point match9 {TenPri[i] =x; One return true; A } - } - } the return false; -}
Note that traversing the elements of the collection in the main function each time the VIS array is zeroed before the next element in Find.
Example: high-dimensional universe, matrix game
Dichotomy--A brief description of the Hungarian algorithm