Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for directed, weighted graphs and code cleanup #12

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

steenfatt
Copy link

@steenfatt steenfatt commented Dec 12, 2018

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.

@joewilaj
Copy link

What adjustments are necessary to run on python3?

@MikeB2019x
Copy link

MikeB2019x commented Feb 3, 2023

@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.

@asmuzsoy
Copy link

What would need to change for this to work on undirected, weighted graphs? Or, could this be hacked by just adding two directed, weighted edges in opposite directions instead of one weighted undirected edge between two nodes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants