Graph Representation Part 02 - Adjacency Matrix - English
Graph Representation Part 02 - Adjacency Matrix - English
which
is name of a node
object
you here is a
representation
efficient in terms of
operations
node
in the graph
vertices.
of number of
design.
two-dimensional array
two-dimensional matrix
vertex list
is zeroth node,
B is 1th node, C is
2th
so if the graph
as 1 or boolean value
2 and 3. Vertex 1
is connected to 0, 4 and 5.
so
1th row and 0th column should also be
set as 1.
to 0
4 is connected to 1 and 7,
6 is connected to
to 3, 4, 5 and 6.
each edge.
two halves.
graph in which
edges or connections are stored in a
matrix
of finding
index
list
number of vertices
vertices.
a name
cost us big oh of V.
finding if 2 nodes
at
So if
to do the scanning
cost us big oh of V.
Big oh of V.
anything.
cost of finding
my lessons so far.
see
number of vertices.
representation
can have
minus infinity
ever be a valid
edge weight. Okay, now for further
discussion
Ajacency matrix
always.
on
memory usage
units of memory.
of it
which probably is
dense,
to V square
sparse
consuming
close to V sqaure
is a node
10 to the power 9
of connections
in our social network can ever be close
is a friend of
billion users.
a thousand friends
10 to the power 12
undirected graph
that we do not
of vertices.
and moreover
sense
is alot. 10 to the power 18 bytes
physical disk.
hand
much of storage.
large
dense
even matter
sparse
fit.
think about
in a graph
the
sparse.
frequently performed
of space
another
much space