Shortest-path problem is one of the well-known optimization problems that has been studied by many scientists in recent years. Applications of this problem such as transportation and communication are generally solved by Dijkstra's Algorithm (Labeling). In this paper, two separate scientific fields, electronics and operation research have been linked to each other and a new algorithm has been created for to find the optimization solution of a shortest- path problem by using electric networks and rules. The proposed algorithm can solve the shortest-path problem in directed graphs and no order ones, and also can solve the longest path problems in directed graphs. In this algorithm, electrical network are used in a way that the resistance val...