Git Product home page Git Product logo

glam's Introduction

GLAM: Graph Layout Aesthetic Metrics

A high-performance implementation for computing graph layout aesthetic metrics described in our paper:

@article{kwon18wgl,
    title={{What Would a Graph Look Like in This Layout? A Machine Learning Approach to Large Graph Visualization}},
    author={Kwon, Oh-Hyun and Crnovrsanin, Tarik and Ma, Kwan-Liu},
    journal={IEEE Transactions on Visualization and Computer Graphics},
    year={2018},
    volume={24},
    number={1},
    pages={478-488}
}

Oh-Hyun Kwon, Tarik Crnovrsanin, and Kwan-Liu Ma are with VIDI Labs at the University of California, Davis.

Requirements

Build

mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release; make

Usage

# glam FILEPATH(s) -m METRIC(s)
> ./glam ../data/karate.dot -m crosslessness
Loading graph: ../data/karate.json
Computing metric: crosslessness
crosslessness=0.970909 (num_edge_crossings=72)

# multiple files and metrics
> ./glam ../data/karate.dot ../data/power.json -m crosslessness shape_gabriel
Loading graph: ../data/karate.dot
Computing metric: crosslessness
crosslessness=0.970909 (num_edge_crossings=72)
Computing metric: shape_gabriel
shape_gabriel=0.376176

Loading graph: ../data/power.json
Computing metric: crosslessness
crosslessness=0.999888 (num_edge_crossings=2426)
Computing metric: shape_gabriel
shape_gabriel=0.320775

# help
> ./glam --help
Options:
   -i [ --input-file ] arg input file(s)
   -m [ --metric ] arg     metric(s) to compute. Available metrics:
                           crosslessness, edge_length_cv, shape_gabriel,
                           shape_delaunay
   --help                  print help message

Metrics

crosslessness: This metric is defined in H. C. Purchase. Metrics for Graph Drawing Aesthetics. Journal of Visual Languages and Computing, 13(5):501–516, 2002.

> ./glam ../data/cond-mat.json -m crosslessness
Loading graph: ../data/cond-mat.json
Computing metric: crosslessness
crosslessness=0.995233 (num_edge_crossings=5396100)

edge_length_cv: This metric is defined in S. Hachul and M. Junger. Large-Graph Layout Algorithms at Work: An Experimental Study. Journal of Graph Algorithms and Applications, 11(2):345–369, 2007. The normalized definition is in our paper.

> ./glam ../data/cond-mat.json -m edge_length_cv
Loading graph: ../data/cond-mat.json
Computing metric: edge_length_cv
edge_length_cv=0.724552 (normalized_cv=0.00332122)

min_angle: This metric is defined in H. C. Purchase. Metrics for Graph Drawing Aesthetics. Journal of Visual Languages and Computing, 13(5):501–516, 2002.

> ./glam ../data/cond-mat.json -m min_angle
Loading graph: ../data/cond-mat.json
Computing metric: min_angle
min_angle=0.397181

shape_delaunay: This metric is defined in P. Eades, S.-H. Hong, A. Nguyen, and K. Klein. Shape-Based Quality Metrics for Large Graph Visualization. Journal of Graph Algorithms and Applications, 21(1):29–53, 2017.

> ./glam ../data/power.json -m shape_delaunay
Loading graph: ../data/power.json
Computing metric: shape_delaunay
shape_delaunay=0.274121

shape_gabriel: This metric is defined in P. Eades, S.-H. Hong, A. Nguyen, and K. Klein. Shape-Based Quality Metrics for Large Graph Visualization. Journal of Graph Algorithms and Applications, 21(1):29–53, 2017.

> ./glam ../data/power.json -m shape_gabriel
Loading graph: ../data/power.json
Computing metric: shape_gabriel
shape_gabriel=0.320775

Data format

See data directory for example data files. The example data are obtained from graph-tool.

Graphviz dot format:

graph G {
0 [x="-17.872", y="24.5203"];
1 [x="-13.6346", y="20.4381"];
2 [x="-16.0092", y="16.7716"];
1--0 ;
2--0 ;
}

JSON format:

{
    "nodes": [
        {"x": -17.872019430477007, "y": 24.520299748437747},
        {"x": -13.634590227372781, "y": 20.438110276467413},
        {"x": -16.009214853752148, "y": 16.771614256121076}
    ],
    "links": [
        {"source": 0, "target": 1},
        {"source": 0, "target": 2}
    ]
}

Acknowledgement

This research has been sponsored by the U.S. National Science Foundation through grant IIS-1741536: Critical Visualization Technologies for Analyzing and Understanding Big Network Data.

glam's People

Contributors

kwonoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

glam's Issues

cannot compile with find_package(TBB) error

Hi there,

I could not compile the program by default CMakeList.txt with the following errors:
`-- Unable to find TBB
CMake Warning at CMakeLists.txt:18 (find_package):
By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CGAL", but
CMake did not find one.

Could not find a package configuration file provided by "CGAL" with any of
the following names:

CGALConfig.cmake
cgal-config.cmake

Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
"CGAL_DIR" to a directory containing one of the above files. If "CGAL"
provides a separate development package or SDK, be sure it has been
installed.

-- Shape based metric requires CGAL
-- Boost version: 1.65.1
-- Found the following Boost libraries:
-- graph
-- program_options
-- Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)
CMake Error at CMakeLists.txt:42 (message):
Unable to find OpenCL

-- Configuring incomplete, errors occurred!`

If I change find_package(TBB) to find_package(TBB REQUIRED), another error raises:
`CMake Error at cmake/modules/FindTBB.cmake:80 (message):
Required library TBB not found.
Call Stack (most recent call first):
cmake/modules/FindTBB.cmake:273 (findpkg_finish)
CMakeLists.txt:9 (find_package)

-- Configuring incomplete, errors occurred!`

Thanks in advance:)

Shiqi

"Unable to find OpenCL devices"

Problem
When computing the "crosslessness" metric, it could happen that a std::runtime_error is thrown with "Unable to find OpenCL devices" even though there are devices available on the machine.

Possible cause
The available devices get filtered by CL_DEVICE_TYPE_CPU and CL_DEVICE_TYPE_ACCELERATOR for which they might not qualify.

Workaround
By changing lines 250 and 251 in glam/include/kw/graph/layout/metric/edge_crossing.hpp from

for (auto& device : platform.devices(CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR)) {
to
for (auto& device : platform.devices()) {

the available devices don't get filtered and appear in the list. This workaround has fixed the issue for me (running on wsl2).

How Can I install it?

I am facing the following problems while installing it. What might be the reason?

/data/morahma/Softwars/glam/include/kw/algorithm/normalize.hpp:32:41: error: parameter declared ‘auto’
tbb::parallel_for_each(c, [=](auto& x) { x = (x - min) / range; });
^
/data/morahma/Softwars/glam/include/kw/algorithm/normalize.hpp: In lambda function:
/data/morahma/Softwars/glam/include/kw/algorithm/normalize.hpp:32:46: error: ‘x’ was not declared in this scope
tbb::parallel_for_each(c, [=](auto& x) { x = (x - min) / range; });
^
In file included from /data/morahma/Softwars/glam/include/kw/graph/layout/metric.hpp:10:0,
from /data/morahma/Softwars/glam/src/main.cpp:14:
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/edge_length.hpp: In function ‘double kw::edge_length_cv(const Graph&, PositionMap)’:
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/edge_length.hpp:39:18: error: parameter declared ‘auto’
[&](auto itr) {
^
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/edge_length.hpp: In lambda function:
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/edge_length.hpp:40:42: error: ‘itr’ was not declared in this scope
auto const e = boost::get<0>(itr);
^
In file included from /data/morahma/Softwars/glam/include/kw/graph/layout/metric.hpp:11:0,
from /data/morahma/Softwars/glam/src/main.cpp:14:
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/min_angle.hpp: In function ‘double kw::min_angle_metric(const Graph&, PositionMap)’:
/data/morahma/Softwars/glam/include/kw/graph/layout/metric/min_angle.hpp:48:69: error: parameter declared ‘auto’
kw::make_iterator_range(boost::vertices(g)), [&](auto const u) {
^

kw Error

When I'm compiling with c++14 I'm getting this error...
abhikasera@abhikasera:~/Downloads/Project/glam-master/src$ c++ -std=c++14 -I /home/abhikasera/Downloads/Project/glam-master/include main.cpp -o main
main.cpp: In function ‘void compute_shape_delaunay(const Graph&, PositionMap)’:
main.cpp:132:5: error: ‘delaunay_triangulation’ is not a member of ‘kw’
kw::delaunay_triangulation(s, svp_pos);
^
main.cpp: In function ‘void compute_shape_gabriel(const Graph&, PositionMap)’:
main.cpp:147:5: error: ‘delaunay_triangulation’ is not a member of ‘kw’
kw::delaunay_triangulation(s, svp_pos);

Can you tell me how to run it with Cmake??

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.