Skip to content

Instantly share code, notes, and snippets.

@Vini2
Created March 6, 2020 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vini2/b3dbb486f6f826122a9ae4ff877ffb01 to your computer and use it in GitHub Desktop.
Save Vini2/b3dbb486f6f826122a9ae4ff877ffb01 to your computer and use it in GitHub Desktop.
Label propagation demo for a simple graph
Display the source blob
Display the rendered blob
Raw
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