# Symetric Matrix calculation

• 2012-12-21, 18:57
aktarjahan2003
Symetric Matrix calculation
Hi
Need some help about symetric matrix calculation. Need some generic formula to calculate in particular order.

-1 51 54 25 77
51 -1 44 70 96
54 44 -1 87 94
25 70 87 -1 88
77 96 94 88 -1

I want to add several items to make an array of sum in this order.
Example,
sum = 01 +12 + 23 + 34+ 45
(start with element row 0 column 1, last column number is index for next element)

some more example:
sum = 01 +13 + 34 + 45+ 52
sum = 01 +14 + 45 + 52+ 23
sum = 01 +15 + 52 + 23+ 34

sum = 02 +23 + 34 + 45+ 51
sum = 02 +24 + 45 + 51+ 13 and so on.

Each sum should take maximum number (maximum row or column, an item column is row for next item and each column is taken only one times)
as number of items in the matrix. If row and column is same we don't add it or if the cell value is -1.

How can I generelize these?

Br
Aktar
• 2012-12-21, 23:45
wizard_hu_
Re: Symetric Matrix calculation
Most programming languages support arrays, indexing of arrays, and loops. C++ is not an exception.
• 2012-12-22, 08:20
aktarjahan2003
Re: Symetric Matrix calculation
[QUOTE=wizard_hu_;908478]Most programming languages support arrays, indexing of arrays, and loops. C++ is not an exception.[/QUOTE]

I know, would be nice if you can give me general formula for this, I would like to include it in my app. I spent sometimes and looks difficult for me,
• 2012-12-22, 10:26
wizard_hu_
Re: Symetric Matrix calculation
This description is not entirely clear to me. Is it some kind of spanning-tree generator for weighted graphs? ([url]http://en.wikipedia.org/wiki/Spanning_tree[/url], [url]http://en.wikipedia.org/wiki/Weighted_graph[/url])
• 2012-12-29, 11:00
aktarjahan2003
Re: Symetric Matrix calculation
[QUOTE=wizard_hu_;908486]This description is not entirely clear to me. Is it some kind of spanning-tree generator for weighted graphs? ([url]http://en.wikipedia.org/wiki/Spanning_tree[/url], [url]http://en.wikipedia.org/wiki/Weighted_graph[/url])[/QUOTE]

Hi,