The transition of copper cable technology to fiber optic is very triggering the development of technology where data can be transmitted quickly and accurately. This cable change can be seen everywhere. This cable is an expensive cable. If it is not installed optimally, it will cost enormously. This excess cost can be used to other things to support performance rather than for excess cable that should be minimized. Determining how much cable use at the time of installation is difficult if done manually. Prim's algorithm can optimize by calculating the minimum spanning tree on branches used for fiber optic cable installation. This algorithm can be used to shorten the time to a destination by making all the points interconnected according to the points listed. Use of this method helps save the cost of fiber optic construction.