31179 Gongju (provisional designation 1997 YR2) is a stony Nysian asteroid from the inner regions of the asteroid belt, approximately 5 kilometers (3 miles) in diameter. It was discovered on 21 December 1997, by Japanese amateur astronomer Naoto Sato at his Chichibu Observatory near Tokyo, central Japan. The S-type asteroid has a rotation period of 4.8 hours and possibly an elongated shape. It was named for the South Korean city of Gongju.