Qt Graph Drawing [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've recently begun development on a project that requires me to visualize graphs, and I am looking for a decent algorithm to tackle this problem.
The graphs I'm drawing model data flow, so a reasonable drawing could be left-to-right or top-to-bottom. They are, of course, directed and mostly acyclic -- that is, there might be a few backwards edges, but these would be a small proportion and I would be happy to remove these before calculating vertex positions if having a DAG as input would substantially improve runtime.
I'm using C++ and Qt for this project and am already very familiar with the Elastic Nodes and the Diagram Scene examples Qt provides. If anyone has seen KCacheGrind, what I'm trying to do is similar to its call graph visualization.
My current attempts have included an original algorithm that assigns each node to a layer based on its minimum distance from the root and then tries to position the nodes inside each layer in such a way that edge crossings are minimized. I was unable to implement the last part of that correctly, and I believe the problem to be NP-Hard.
What I'm looking for is guidance as to what kinds of algorithms have been used to efficiently solve this problem in the past.

I'd suggest using QGraphicsScene to implement directed acyclic graph. Also please check these links to help you out with implementation:
https://github.com/qknight/automate
http://invalidmagic.wordpress.com/2009/12/10/qgraphicsscene-used-as-a-qabstractitemmodel/
http://socnetv.sourceforge.net/

Related

What UI lib or something can i use to simulate traffic conditions with moving stuff with C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Our Object-oriented technology curriculum's homework:
using object-oriented language to implement a application simulating traffic condition, with following requirements:
Must have UI to simulate traffic scenaria (moving cars, changing traffic lights etc.).
There are traffic lights at the intersections
Car have limited turning options when encounting traffic lights at intersections
I want to use C++ to implement this application, but i never have had experience coding for user interface. how to program with c++ to implement something that can make some dynamic illustration to show my application? can Qt satisfy my requirements? if not what lib can i use?
Here is a quick start for you:
http://qt-project.org/doc/qt-4.8/graphicsview-collidingmice.html
Study the example and figure out what is going on.
Change the mice into cars. Create boundary conditions for how they navigate. Maybe swap the subclass to a QGraphicsPixmapItem, or a QGraphicsRectItem.
Change what they do as they approach or intersect with another car.
Then when you are ready, add in traffic light representation, and have the cars detect the upcoming traffic light.
Instead of just detecting collisions at the time of drawing, you can have a QTimer event that recalculates the "driving decision" of the car based on the nearby cars and what they were doing.
Use QPropertyAnimations.
http://qt-project.org/doc/qt-4.8/animation-animatedtiles.html
Hope that helps.

finding static scheduling of DAG for multiprocessors - library? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I have a graph of the dependencies of all tasks, and the costs of each task. Now I want to calculate a scheduling for a given amount of CPUs. I've found many papers on scheduling algorithms, optimal schedulers seem to be too expensive for my problem size (around 100 nodes) as it's an NP-hard problem. I'd settle for a heuristic, preferably one that has a bound how close it gets to the optimum. My problem now is: do I really have to code it myself?? This should have been solved many times before, it can be easily applied to project management, maybe there something exists?
If you happen to know a library in python that'd be perfect or the next best thing would be C++, otherwise i'd settle for anything else.
This is a pretty common problem. It also shows up in hardware design.
There has been a lot of work on algorithms to solve it.
If you are going to write something yourself, start by checking out "Hu's Algorithm".
If you just want a solution, these functions are built into architectural synthesis programs.
Look at the Wikipedia pages on high level synthesis and logic synthesis.
There are several professional tools that can handle this, if you can get access to them through school or work.
There are university programs you can often get for free that can also handle this problem.
I'm not up-to-date on what is currently available. An very old one is MIS II from Berkeley. It's scripting language was Tcl, not Python.

Very easy to use 2d (optionally 3d) drawing library / wrapper for directx or opengl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm studying physics and I know C++ at a basic level. at my study it's sometimes really useful to create a program which can graphicly represent some data or do calculations and then graphicly represent them. I read that, for example, to be able to master the basics of openGL I would need to do a 10 week long course of openGL. But that is too much time.
I'm wondering if there are any libraries available (for windows) which allow me to do some easy stuff like:
-DrawPixel(x,y,color)
-DrawCircle/Line/Shape/Polygon([list of points])/Triangle/Square (+rotation)
-DrawImage(filename,width,height,etc...)
-DrawText()
Is there any library which has this easyness? It would be really cool because if I do something (create a program) and I need to explain my team (who have never programmed) how I have done it (the program / results), this would make it much easier to explain!
I looked at SDL, HGE, OpenFrameworks (somewhat the "closest" yet still far away) and a few other popular libraries but they are all so far away.. why is there no such easy library?
Are there any available which are just not being found with the keywords i search in google?
I would suggest that you take a look at cinder. Try out the Hello Cinder tutorial. I think you will find it supports your needs by providing an abstraction layer above DirectX or OpenGL.

List of C++ libraries for Graph Theory [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm going to start a scientific project about automata and graph theory, and I'm searching for a graph library that supports features like:
directed/undirected graphs
graph isomorphism test (i.e. is graph g1 isomorphic w.r.t. g2?)
subgraph isomorphism test (i.e. is a graph g1 isomorphic to a subgraph of g2?)
graph search, visits and such
possibly, quite fast since I need to make some serious computations
I know about the Boost Graph Library, but it lacks subgraph testing as far as I understood from its documentation.
So, my question is: which are the best c++ graph libraries, please?
They do not have to provide support for every feature I need, I know it's certainly possible that no existing library fits perfectly my needs.
You could use iGraph: http://igraph.sourceforge.net/ which is a C library which should satisfy what you are after.
There is also http://ubietylab.net/ubigraph/, there is a related SO post here: https://stackoverflow.com/questions/2751826/which-c-graph-library-should-i-use.
I have not used ubigraph so cannot comment on that, I mainly use networkX and iGraph
UPDATE
It seems that ubigraph is dead now so only igraph is maintained currently
You may use Cliquer library http://users.tkk.fi/pat/cliquer.html for all calculations related to finding cliques.

Geometry library in C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I am looking for an easy to use and well documented geometry library in c++. I would like to use it in 3D perception that I am dealing with point clouds. Coordinate transformations, rotations and translations are my special concern now. Any suggestion?
A very powerful library is cgal. Some of the functions in opengl may also be of use.
Check out Boost::Geometry
It has some basic point definitions and coordinate systems as well as distance calculations. From there you can extend it as needed.
There's also some intersection routines and things to find convex hulls from clouds of points.
Check out this site. It gives you a very good overview about existing geometry libraries, even with some pros and cons.
Update:
And you may also have a look at the Point Cloud Library. It's quite a new library for working with point clouds, easy to understand and has plenty of good tutorials to get started with!
PLIB: A Suite of Portable Game Libraries
Note: Just because it says "game" it doesnt mean you cant use it in anything other than developing games.
If you're going to render your geometries in a VGA screen, I strongly recommend you to use microsoft DirectX library which is the best one for graphics rendering. Otherwise, just go with Boost::Geometry library which would be enough for your purpose.