Giter VIP home page Giter VIP logo

Comments (6)

georgios-ts avatar georgios-ts commented on August 15, 2024 2

In fact i have started working on it but we can coordinate or add different layouts

from rustworkx.

Chriscrosser3310 avatar Chriscrosser3310 commented on August 15, 2024 1

Has anyone been working on this already? If not I'll do it

from rustworkx.

mtreinish avatar mtreinish commented on August 15, 2024 1

My first response is that I would probably say for more complex algorithms we probably should just rely on graphviz. The drawer/layouts built into retworkx are more about convenience (so you don't need to install an external tool), I don't think we should expect to match the performance or ability of graphviz with a built-in drawer or layout function. We still will always have the to_dot method to generate a dot file that we can pass to graphviz (a follow up to #304 I plan is to add a python function that wraps pydot as an optional requirement to make it a bit easier to draw).

That being said though, it depends on the complexity and the effort you want to put into the function. If you want to make the improvements as part of #306 or in a follow up PR I think they would be fine to add, and definitely welcome additions. But they're not required, as long as we have a basic spring layout function for retworkx so we can use it for #304 I think that's all we actually require here.

from rustworkx.

Chriscrosser3310 avatar Chriscrosser3310 commented on August 15, 2024 1

For #306: I've been working on some other simpler layouts (4-5 layouts) so I didn't end up colliding with your work haha, but it seems we still wrote duplicate code (recenter/rescale, and some minor things). I guess I'll just keep mine unchanged and make a pull request when I finish, and we can sync after viewing each other's code.

from rustworkx.

mtreinish avatar mtreinish commented on August 15, 2024

Just a heads up I wrote a random_layout function for #304 (since to get that working I needed a layout function and that looked like the simplest). I will eventually split that out into a separate PR (it's technically independent of the mpl drawer), I just pushed it up all together to show the PoC for the drawer. One thing we might want to share between all the layout implementations is the Pos2DLayout custom return type in that, since it should be a lot more efficient to create than building a python dict.

I think once we have a spring layout function that should be the default we use in the matplotlib drawer.

from rustworkx.

georgios-ts avatar georgios-ts commented on August 15, 2024

Although there is still work to do in #306 , i'm wondering if it makes sense to implement some improvements in fruchterman reingold layout algorithm as described here. Specifically, we can use:

  • Quad trees to efficiently (O(n logn) instead of O(n^2)) approximate repulsive forces
  • A multilevel approach with a coarsening scheme.

Both are necessary for fast and nice layouts in large graphs. So, my question is if it's worth spending the time to implement it in retworkx or rely on dedicated tools like GraphViz (this algorithm is in sfdp layout)

from rustworkx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.