Finding a quantum computing method to solve nondeterministic polynomial time (NP)-complete problems is currently of paramount importance in quantum information science. Here we propose and experimentally demonstrate a Rydberg atom approach to program the 3-SAT problem, the prototypical NP-complete problem which allows general programming of all NP problems. We use Rydberg atom graphs, each of which consists of Rydberg atom dimers and trimers coupled with quantum wires in the Rydberg blockade interaction regime, to formulate general Boolean expressions, and obtain their many-body ground states to determine the satisfiabilities of the given 3-SAT problem instances quantum mechanically.