# Algorithm: Min cost in a 2D array

I have the following problem:
a. There is a 2D array with the following mapping:
Node 1 Node 2 Node 3
------------- Node N
Entry1 Cost1,1 Cost1,2 Cost1,3
----------- Cost 1,N
Entry2 Cost2,1 Cost2,2 Cost2,3
------------ Cost 2,N
---------
---------------------------------------------------------------------------------------------------
Entry N CostN,1 CostN,2 CostN,
3------------ CostN,N

b. I need to pick a mapping from EntryK to NodeJ all the way from
Entry1 to EntryN, such that the total cost is the minimum.
c. If we pick up a cost from one column that column needs to be
ignored for other entries.
d. I had thought of generating all the subsets in the set {1,2,.....N}
and then saving those subsets to pick the minimum cost as in {1,3,2,4}
in the subset means Cost1,1 + Cost2,3 + Cost 3,2 + Cost 4,4.

I have the array ready, so I also thought of Dynamic programming in
that I need to save the optimum path. But somehow I am not able to
nail it down.

Thanks,
Roger.

.

## Relevant Pages

• Algorithm: Minimum cost in a 2D array
... There is a 2D array with the following mapping: ... I need to pick a mapping from EntryK to NodeJ all the way from ... such that the total cost is the minimum. ... If we pick up a cost from one column that column needs to be ...
(comp.programming)
• Re: Algorithm: Minimum cost in a 2D array
... There is a 2D array with the following mapping: ... I need to pick a mapping from EntryK to NodeJ all the way from ... such that the total cost is the minimum. ... Are you trying to pick N elements from an NxN matrix such that no two elements have the same row index, no two elements have the same column index, and the sum of the values is a minimum? ...
(comp.programming)
• Re: Algorithm: Minimum cost in a 2D array
... There is a 2D array with the following mapping: ... I need to pick a mapping from EntryK to NodeJ all the way from ... such that the total cost is the minimum. ... will produce the minimum sum. ...
(comp.programming)
• Re: Solar Systems, Entry level--- More
... a 50K solar PV array. ... cost much more to install/re-install a PV array than it does to re- ... MUCH MUCH less than the PV installation), it is typical that the PV ...
(alt.home.repair)
• Re: passing a string to a dll
... Part of the reason I wasn't certain about the cost of std::map is that it is a balanced ... array sounds suspect as a strategy. ... bool IsValidCode(string codeToCheck) ... Putting them in a DLL has effectly zero impact. ...
(microsoft.public.vc.mfc)