Differential constraint system

Negative ring: Because the negative ring must be shorter and shorter, but when all points on a graph are selected, it must not be the shortest path. Therefore, we can think about how to deal with negative rings from this point: The only way to deal with negative rings is \ (\ text{SPFA} \), \ (\ text{dijkstra} \) is not available. When we updat ...

Posted by spartan7 on Wed, 03 Nov 2021 17:40:54 -0700

Weighted union search set

A basic union search set There are only two operations for the basic union query set, one is to find ancestors, and the other is to merge int find(int x) { if(x==pre[x]) return x; else return pre[x]=find(pre[x]); } void join(int x,int y) { pre[find(x)]=find(y); } Two weighted union search set   for weighted concurrent sear ...

Posted by Stevis2002 on Wed, 03 Nov 2021 12:48:17 -0700

2021 Niuke summer multi school training camp 7 xay loves Floyd

General idea of the topic Someone put f l o y d floyd floyd is written as follows. How many more digraphs are there d ...

Posted by srinivas6203 on Sun, 31 Oct 2021 22:55:40 -0700

java data structure - diagram - continuous supplement

On the right side of the page, there is a directory index, which can jump to the content you want to see according to the titleIf not on the right, look for the left Main article: https://blog.csdn.net/grd_java/article/details/120526149 Why is there a map Linear table and tree, linear table is limited to a direct precursor and a direct suc ...

Posted by designsubway on Sun, 31 Oct 2021 20:29:17 -0700

[collection does not get lost] search and fundamentals of graph theory

catalogue 🌠DFS 🌠BFS 🌠 Breadth first traversal of trees and graphs → topological sorting Example: 🌠 shortest path   👉 Single source shortest path (naive Dijkstra) (there must be no negative weight edge) → heap optimization Dijkstra (to be continued...) 👉 Single source shortest path with negative weight edge (Bellm ...

Posted by stringfield on Sun, 31 Oct 2021 10:03:57 -0700

Acwing 1170. Layout (differential constraint)

Acwing 1170. Layout meaning of the title Cows like to stand close to their friends when waiting in line for feeding. Farmer John has N N N cows, number from 1 1 1 to ...

Posted by JayVee on Fri, 29 Oct 2021 05:15:50 -0700

[summary] single source shortest path (naive Dijkstra) and minimum spanning tree (Prim,Kruskal)

catalogue shortest path Plain Dijkstra minimum spanning tree Prim   algorithm Kruskal algorithm   shortest path Plain Dijkstra Time complexity:          O(n2+m) , n   Represents the number of points, M   Represents the number of sides Dense graph 👉    &nbs ...

Posted by apulmca2k4 on Thu, 28 Oct 2021 09:31:10 -0700

On differential constraint

On differential constraint It's still a difficult thing. introduce Consider a limitation A i ≤ x i + ...

Posted by zulx on Wed, 13 Oct 2021 21:54:10 -0700

Graph theory - cf1495d. BFS trees (graph theory shortest path spanning tree + enumeration count + tree hierarchy)

General idea of the topic Main idea of the title: Problem solving ideas: First, we must find the shortest path between any two points → F l o y e ...

Posted by Dada78 on Sat, 18 Sep 2021 09:22:52 -0700