문제

Suppose you have an alphabet with only three characters, say, 0, 1, @. How can you represent an unweighted (all vertices and edges have the weight 1), undirected graph G = (V, E) using only a string of these characters?

도움이 되었습니까?

해결책

you could try an adjacency matrix.

http://en.wikipedia.org/wiki/Adjacency_matrix

maybe use the @ to represent each new line.

so 100@010@001@ would be the identity matrix

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top