struc2vec icon indicating copy to clipboard operation
struc2vec copied to clipboard

Support for directed, weighted graphs and code cleanup

Open steenfatt opened this issue 6 years ago • 3 comments

I have [see corresponding paper] ...

  • added support for directed, weighted graphs
  • added support for partially embedding the graph
  • cleaned up the code, in particular removed unused parts of the code
  • added some missing doc strings

The changes are completely backwards compatible, i.e., any commands that you have been running previously should still work the exact same.

steenfatt avatar Dec 12 '18 09:12 steenfatt

What adjustments are necessary to run on python3?

joewilaj avatar Apr 14 '20 16:04 joewilaj

@joewilaj I got this to run in Python3. Here are the necessary changes:

  • replace occurrences of 'xrange' with 'range'
  • replace occurrences of 'iter.keys' with 'keys'
  • where you see the use of 'G.keys()' put something to convert the output type ('dict_keys') to 'list' where required. G.keys() is usually used to populate the variable 'vertices' which is supposed to be passed to other functions as a 'list' so you have to convert or you'll end up with a "cannot save 'dict_keys' " keys error somewhere
  • replace occurrences of 'cPickle' with 'pickle'
  • replace occurrences of 'iteritems' with 'items'
  • replace the variable names in the Word2Vec call: 'iter' -> 'epochs' and 'size' -> 'vector_size'

That should pretty much do it. As a test run Karate Kid network. BTW it doesn't look like this repo is maintained so that's a shame.

MikeB2019x avatar Feb 03 '23 03:02 MikeB2019x