NUIST preliminary training 20,191,212 graph theory

Four learning algorithm, namely SPFA Dijkstra Kruskal Prim. There topological sorting. Sunday Monday hit a few board title, finished Tuesday on the topic Los Valley, Wednesday and Thursday blind to find two topics did, did not do it as well as a

 

 Front also know the basic principles, the time to do a back problem is with a random bfs optimized. The results Thursday night classes when it suddenly found himself nothing will. The board will not even write, casually brushed up Dijkstra and Kruskal. Topic abnormal results pit father, A, B can only be used spfa, listen to seniors whispered back, probably to remove priority_queue into a queue. This week I'd done a simple question, but that time is prim. Later, messing around over-the A, B. Good luck.

-----------------------------------

SPFA

  SPFA is to continuously relaxation, the solution changed state of relaxation, so in order to get a wide range of optimal solutions it extended out, need to go over the process.

       Because it is node-oriented, need to know which node, and the node corresponding "length, value, cost ......", if there is a more optimal solution, put better solution pull into the ranks, and update the status solution.

Dijkstra

  It can be understood as Priority_queue version of the SPFA, more than a vis array is a node in the loop process while walking only. The reason is, to Node A, it is possible to take the process several times, then A (in this case, a strruct, there also existed the path of this node) {x, wmin} will be at the top, and because Dijkstra is expanding path, which is already a bit set and an external point set (interactive?), then the node does not exist after being processed, and jumping tap out a new path of better access to this node.

 

These days the problem is encountered, for example, why not use the longest path

-----------------------------------

A - a person's travel

Although the grass is Luchi (that is, Hangzhou Electric spent more than a year, will actually get lost on campus people, Khan ~), but the grass is still very fond of traveling, because you'll meet a lot of people (Prince Charming on the road, ^ 0 ^), a lot of things, but also to enrich their experience, you can also see the beautiful scenery ...... the grass go a lot of places she wanted to go to tokyo Tower to see at night, I went to Venice to see the movie, go watch the sea Yangmingshan taro, go to New York purely to see snow, go to Paris to write a cup of coffee, went to Beijing to visit a fairy ...... seeing winter is coming, so a large period of time, can not afford to waste ah, must give themselves good a vacation, but also I can not neglect the training ah, so the grass was decided to go to a place they want to be in the shortest possible time! Because the grass family in a small town, no train passed, so she can go to neighboring cities by train (good poor ah ~).

 

---------------

Social practice tomorrow afternoon escape, Introduction to Computer Science I did not write, did not test the student handbook, four ticket did not print. Headache (physical, first put this right.

 

Guess you like

Origin www.cnblogs.com/asanagiyantia/p/12032356.html