This paper aims to determine an optimal structure for a quadruped robot, which will allow the robot’s joint torque sum to be minimised. An animal’s characteristic limb length ratio is a vital part of its overall morphology and the one that enables it to travel easily through its environment. For the same reason, a robot’s structure needs to be suitably designed for locomotion in its working environment. Joint torques are necessary to maintain the posture of the robot and to accelerate joint angles during walking motion, hence, minimisation of joint torques reduces energy consumption. We performed a numerical simulation in which we analysed the joint torques for various limb lengths and slope angles in order to determine the optimal structure of a robot walking on a slope. Our investigation determines that the optimal Ratio of Rear Leg Length (RRL) can be derived by the use of a simulation designed to determine the physical structure of quadruped robot. Our analysis suggests that joint torque will increase as the slope angle becomes steeper if the rear legs of the robot are shorter than its forelegs, and that joint torque will decrease as the slope angle declines if the robot’s forelegs are shorter than its rear legs. Finally, experimental results validated our simulation analysis.