As in the picture below, we have a weighted chart and we intend to convert this chart into two charts in such a way that the difference in the total weight of the two charts created is the minimum value. The edges of the graph are displayed as a two-dimensional array. The solution I have in mind is to remove one of the edges each time to create two graphs and then calculate the weight of the two graphs created and thus be able to calculate the difference as well. Finally, when we have removed all the edges once and checked all the states, we return the state with the smallest weight difference between the two graphs. I am having trouble implementing this solution. If you can share a sample code with javascript language with me. Grateful
Edges = [ [1,9] , [1,4] , [4,8] , [4,3] , [3,2] , [3,5] , [5,6] , [6,7] ]


