This paper studies optimal sensor selection in discrete event systems modeled by partially observed Petri nets. The goal is to place a minimum number of sensors while maintaining structural observability, i.e., the ability to uniquely determine the system state at any given time step based on sensor information up to that time step, knowledge of the system model, and an arbitrary but known initial state. The problem is important because the majority of existing control schemes for Petri nets rely on complete knowledge of the system state at any given time step. To simplify the problem, we consider two subproblems: the optimal place sensor selection (OPSS) problem and the optimal transition sensor selection (OTSS) problem. The OPSS problem is shown to be computationally hard by establishing that the corresponding decision problem is NP -complete. For this reason, we first reduce the problem to the linear integer programming problem, which can be solved optimally using existing linear integer programming solvers (at least for small problem instances), and then propose two heuristic algorithms to approximate its solution with polynomial complexity. Simulations suggest that the two proposed heuristics run faster and can find reasonably good solutions when compared to optimal methods that are based on linear integer programming solvers. Unlike the OPSS problem, the OTSS problem is solvable with polynomial complexity.