Solid objects are usually modeled by polyhedra in a computer representation. A face of a polyhedron is a planar polygon bounded by straight line segments, called edges. Curved surfaces are usually approximated by a polygon mesh. Computer programs for line drawings of opaque objects must be able to decide which edges or which parts of the edges are hidden by an object itself or by other objects. This problem is known as hidden-line removal. The first known solution to the hidden-line problem was devised by Roberts in 1963. However, it severely restricts the model: it requires that all objects be convex. Ruth A. Weiss of Bell Labs documented her 1964 solution to this problem in a 1965 paper. In 1966 Ivan E. Sutherland listed 10 unsolved problems in computer graphics. Problem number seven was "hidden-line removal". In terms of computational complexity, this problem was solved by Devai in 1986. Models, e.g., in computer-aided design, can have thousands or millions of edges. Therefore, a computational-complexity approach, expressing resource requirements, such as time and memory, as the function of problem sizes, is crucial. Time requirements are particularly important in interactive systems. Problem sizes for hidden-line removal are the total number n of the edges of the model and the total number v of the visible segments of the edges. Visibility can change at the intersection points of the images of the edges. Let k denote the total number of the intersection points of the images of the edges. Both k = Θ and v = Θ in the worst case, but usually v < k.
Algorithms
Hidden-line algorithms published before 1984 divide edges into line segments by the intersection points of their images, and then test each segment for visibility against each face of the model. Assuming a model of a collection of polyhedra with the boundary of each topologically equivalent to a sphere and with faces topologically equivalent to disks, according to Euler's formula, there are Θ faces. Testing Θ line segments against Θ faces takes Θ time in the worst case. Appel's algorithm is also unstable, because an error in visibility will be propagated to subsequent segment endpoints. Ottmann and Widmayer and Ottmann, Widmayer and Wood proposed O-time hidden-line algorithms. Then Nurmi improved the running time to O. These algorithms take Θ, respectively Θ time in the worst case, but if k is less than quadratic, can be faster in practice. Any hidden-line algorithm has to determine the union of Θ hidden intervals on n edges in the worst case. As Ω is a lower bound for determining the union of n intervals, it appears that the best one can hope to achieve is Θ worst-case time, and hence Nurmi's algorithm is optimal. However, the log n factor was eliminated by Devai, who raised the open problem whether the same optimal O upper bound existed for hidden-surface removal. This problem was solved by McKenna in 1987. The intersection-sensitive algorithms are mainly known in the computational-geometry literature. The quadratic upper bounds are also appreciated by the computer-graphics literature: Ghali notes that the algorithms by Devai and McKenna "represent milestones in visibility algorithms", breaking a theoretical barrier from O to O for processing a scene of n edges. The other open problem, raised by Devai, of whether there exists an O-time hidden-line algorithm, where v, as noted above, is the number of visible segments, is still unsolved at the time of writing.
Parallel algorithms
In 1988 Devai proposed an O-time parallel algorithm using n2 processors for the hidden-line problem under the concurrent read, exclusive writeparallel random-access machinemodel of computation. As the product of the processor number and the running time is asymptotically greater than Θ, the sequential complexity of the problem, the algorithm is not work-optimal, but it demonstrates that the hidden-line problem is in the complexity class NC, i.e., it can be solved in polylogarithmic time by using a polynomial number of processors. Hidden-surface algorithms can be used for hidden-line removal, but not the other way around. Reif and Sen proposed an O-time algorithm for the hidden-surface problem, using OCREW PRAM processors for a restricted model of polyhedral terrains, where v is the output size. In 2011 Devai published an O-time hidden-surface, and a simpler, also O-time, hidden-line algorithm. The hidden-surface algorithm, using n2/log n CREW PRAM processors, is work-optimal. The hidden-line algorithm uses n2exclusive read, exclusive write PRAM processors. The EREW model is the PRAM variant closest to real machines. The hidden-line algorithm does O work, which is the upper bound for the best sequential algorithms used in practice. Cook, Dwork and Reischuk gave an Ω lower bound for finding the maximum of n integers allowing infinitely many processors of any PRAM without simultaneous writes. Finding the maximum of n integers is constant-time reducible to the hidden-line problem by using n processors. Therefore, the hidden-line algorithm is time optimal.