Gradient and nongradient optimization algorithms are currently available for structural design in structural optimization course. Despite the successful application of gradient algorithm in structural optimization, nongradient algorithm is also extensively adopted to solve the structural optimization problem. However, the efficiency of nongradient algorithm has caused a heated debate recently. To clarify this issue for the graduate students, sequential linear programming and genetic algorithm are, respectively, chosen as the representatives of gradient and nongradient algorithms to solve truss size optimization problem. Firstly, the size optimization formulations of truss structure for sequential linear programming and genetic algorithm are summarized, respectively. Secondly, an educational finite element software for truss structure is developed by using the object-oriented programming to create the software framework. This study aims to provide an open-source, extensible, and benchmarking software, which do assist the students to understand the structural optimization process in engineering education. Finally, two benchmarking examples are introduced to compare the efficiency and accuracy of sequential linear programming and genetic algorithm.