Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Label propagation demo for a simple graph
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shaysingh818
Copy link

shaysingh818 commented Mar 19, 2023

@Vini2 If this is an UN-directed graph, wouldn't the adjacency matrix look something like this?

 1.00 0.00 0.00 1.00 0.00 0.00 0.00
 0.00 1.00 0.00 0.00 0.00 1.00 0.00
 0.00 0.00 0.00 1.00 0.00 0.00 0.00
 1.00 0.00 1.00 0.00 1.00 0.00 0.00
 0.00 0.00 0.00 1.00 0.00 1.00 0.00
 0.00 1.00 0.00 0.00 1.00 0.00 1.00
 0.00 0.00 0.00 0.00 0.00 1.00 0.00

It could be something wrong the matrix version of my graph library for inserting entries. When I tried to replicate the graph above, this was the adjacency matrix that came out for me.

Neighbor Visuals

0 : -> A-> D
1 : -> B-> F
2 : -> D
3 : -> A-> C-> E
4 : -> D-> F
5 : -> B-> E-> G
6 : -> F

@shaysingh818
Copy link

I guess the main question is what are the neighbors of 1 and 2 supposed to be? 0 and 1 in my context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment