I want to implement a 2-SAT problem for 100,000 literals. Thus, there would be 200,000 peaks. So I was stuck with having an array of all reachable vertices from each vertex, a space complexity O(200000^2)that is not feasible. Therefore, please suggest a solution for this. And please, shed some light on the effective implementation of the problem with 2-SAT.
O(200000^2)
From wikipedia :
... 2-feasibility can be solved in polynomial time. As noted by Aspvall, Plass and Tarjan (1979) , a 2-satisfiability instance is decidable if and only if each instance variable belongs to a different strongly-connected component of the implication graph than the negation of the same variable. Since strongly coupled components can be found in linear time by an algorithm based on the first depth search, the same linear time boundary is also applicable to 2-satisfiability.
, , , , , 2-SAT ( ). , 20 . , , !
update: PDF . liori .
. , 2- , - . 2-sat , 200 000 (200000 * 199999)/2, , , , , ( , , ).
Source: https://habr.com/ru/post/1721754/More articles:Creating compile-time errors for invalid data types in a template class? - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1721750/how-do-you-stay-user-oriented-when-it-comes-to-your-long-term-project&usg=ALkJrhgCcwxZ7jIvfVzZFOF7talu3Ar_FwThe message UINavigationItem.prompt appears. How to listen to the new invitation? - iphonehow to represent a number from a range in binary format? - binaryNHibernate Inheritance - discriminator value - c #an error occurred while passing a reference to a derived object in a method - inheritancePhysical file path - c #Проблемы с вращением 3D-глобуса - rotationDoes stack size increase at runtime? - cGenerate C ++ code for BNF grammar - c ++All Articles