In order to solve the problem that traditional mechanical and electrical cable design relies heavily on experience and lacks optimization in structure design, aiming at the particularity of cable component design, after comparing several intelligent optimization algorithms synthetically, commonly used A* algorithm and genetic algorithm, which are suitable for cable design, are selected and improved in order to realize the intelligent optimization design of cable component. Firstly, the main technologies needed to be considered in actual cabling design are analysed; the cabling environment requirements of intelligent optimization algorithm are compared, and the automatic generation method of cabling environment is obtained based on three-dimensional software; A* algorithm considering cabling technology is designed and improved to plan the cabling path. The application of genetic algorithm in the design of cable branching structure is analysed, and the partial operation of genetic algorithm is improved to optimize the performance of the algorithm; and then A* algorithm is introduced into the fitness function of genetic algorithm to realize the global optimization design of branching structure and path in cable design. The research results confirm that the hybrid algorithm of A* algorithm and genetic algorithm has certain advantages in the design of cable for mechanical and electrical products. It improves the traditional design algorithm and greatly improves the efficiency of the design of cable for mechanical and electrical products.