Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Gephi Cookbook
Gephi Cookbook

Gephi Cookbook: Over 90 hands-on recipes to master the art of network analysis and visualization with Gephi

€28.99 €19.99
Book May 2015 296 pages 1st Edition
eBook
€28.99 €19.99
Print
€37.99
Subscription
€14.99 Monthly
eBook
€28.99 €19.99
Print
€37.99
Subscription
€14.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : May 27, 2015
Length 296 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783987405
Concepts :
Table of content icon View table of contents Preview book icon Preview Book

Gephi Cookbook

Chapter 1. Getting Started with Gephi

In this chapter, we will cover the following recipes:

  • Installing Gephi

  • Troubleshooting the Gephi installation

  • Exploring Gephi's graphical user interface

  • The basics of working in the Overview mode

  • The basics of working in the Data Laboratory mode

  • The basics of working in the Preview mode

Introduction


Gephi is an interactive graph and network analysis and visualization tool that allows its users to study the properties of graphs and networks in detail, without having to write any code. Gephi supports almost all types of graphical networks including complex networks, hierarchical networks, dynamic networks, and temporal networks. Gephi has a lot of ready-to-use features that allow users to create stunning and informative visualizations. Graph analysis is one of the preliminary steps in the process of studying graphical systems and Gephi aids in that process by freeing the user from requiring knowledge of programming.

Gephi was developed in Java and, hence, is a cross-platform application, which means it can work on Windows, Linux, and Mac OS X. This chapter will take you through the step-by-step process involved in installing Gephi on different platforms. We will also discuss troubleshooting that might be required during the installation process.

This chapter also gives you an overview of Gephi's graphical user interface (GUI) and a basic understanding of various modes available in it.

Installing Gephi


This recipe discusses the minimum system configurations required in order to install Gephi and the installation process for different platforms.

Getting ready

Gephi, being a network analysis and visualization tool, requires a compatible graphics card to be installed on your system. It uses a built-in OpenGL engine for fast processing when dealing with very large networks. Hence, it requires OpenGL 1.2 installed on your system. Gephi also requires Java 6 or later. Make sure you have these two programs installed on your system before you go ahead with the installation process.

How to do it…

Follow these steps to install Gephi on Windows:

  1. Download the Gephi installer from the official website: https://gephi.github.io.

  2. Run the installer and hit Next:

  3. Accept the license agreement and hit Next:

  4. Keep clicking on the Next button until you reach the following screen. Click on Install:

  5. The installation will begin and once it's over, the following screen is displayed. Hit Finish to complete the setup:

To install Gephi on a Linux machine, follow these steps:

  1. From Gephi's official website (https://gephi.github.io), download the TAR installer file.

  2. Once the download has finished, untar the file and run Gephi by executing ./bin/gephi.

  3. Ubuntu users can make use of the daily build, available from Launchpad. First, run sudo apt-add-repository ppa:rockclimb/gephi-daily to your software sources.

  4. Then, run sudo apt-get update, followed by sudo apt-get install gephi, in order to install Gephi on your box.

The installation process for Mac OS X is pretty simple and straightforward:

  1. From Gephi's official website (https://gephi.github.io), download the installer.

  2. Once the download has finished, double-click on the DMG file to run the installer.

  3. Once the installation has finished, a new window will open. Double-click on the Gephi icon to run the application.

There's more…

As mentioned earlier, Gephi is a cross-platform tool and works on many more platforms than the ones described in this recipe. If the graphs on which you are going to work are very large, then a 64-bit version of Gephi will have to be installed if you are also using a 64-bit machine.

One might face some issues while installing Gephi, most of which are related to memory management in Java. To learn about fixing some of the most common ones, refer to the next recipe, Troubleshooting the Gephi installation.

See also

Troubleshooting the Gephi installation


While installing Gephi, there are a couple of problems that users encounter quite frequently, most of which are related to memory-specific requirements. Some of these issues are discussed in this recipe, along with the fixes that one can employ to resolve them.

How to do it…

If you encounter any memory- or JVM-related issues, try following these steps to check if the issue can be resolved:

  1. If you are using Java 8, try downgrading to Java 7 and check whether the problem is resolved.

  2. If you are using the latest version of Gephi, uninstall it and install an older version. If these two fixes do not resolve the problem, then you might need to do operating system-specific fixes, as listed in the following points:

    • For Windows systems, go to the Gephi folder in Program Files in C:\ and then go to the etc folder. Open the gephi.conf file in Notepad. In the default options, change the -J-Xmx512m value to -J-Xmx1024m. This changes the maximum heap size allocated to Java to 1,024 MB. If you are using a 64-bit machine, the gephi.conf file will be located in the Gephi folder in C:\Program Files(x86).

    • For Linux systems, go to the etc folder in the Gephi application directory and open the gephi.conf file. Change the -J-Xmx512m value to -J-Xmx1024m to change the maximum heap size allocated to Java to 1,024 MB.

    • For Mac OS X systems, go to Show Package Contents by right-clicking on the Gephi icon in the Applications folder. Inside the Contents folder, go to the Resources/Gephi/etc folder. Open the gephi.conf file and, in the default options, change the -J-Xmx512m value to -J-Xmx1024m. This changes the maximum heap size allocated to Java to 1,024 MB.

Tip

Unable to save the modified gephi.conf file? Open your text editor in administrator mode, navigate to the folder where the file is located, open the file, and then make the changes. Finally, hit Save to save the changes.

How it works…

Java Virtual Machine (JVM) is an abstract computing machine, otherwise known as a virtual machine. A virtual machine emulates a part of the computing system. JVM executes a Java program compiled into Java bytecode. Since Gephi runs on JVM, its functioning depends on the memory allocated in the system for Java. If very little memory has been allocated to Java, it won't have enough resources to load all the data and, hence, the application won't start. On the other hand, if too much memory has been allocated to Java, then the system won't let Java start and will throw the "JVM Creation failed" message.

Exploring Gephi's graphical user interface


Gephi offers a very user-friendly GUI to users, making it very easy for novices to explore and manipulate networks with just a few clicks of the mouse.

Getting ready

This recipe describes some of the main GUI components of Gephi and gives the user an overview of what can be achieved. For this, you need to make sure that you have Gephi installed on your system.

How to do it…

To explore Gephi's GUI, perform the following steps:

  1. Run Gephi on your system. You'll be welcomed with a small screen, as shown in the following screenshot, that asks you to choose between loading a preexisting sample and creating a new project:

  2. If it is your first time with Gephi, click on Les Miserables.gexf to load an existing network that was designed using the property of concurrence between the characters from the famous novel Les Misérables by Victor Hugo.

  3. You will notice a prompt titled Import report asking you to set the properties for the graph. Just leave the pre-specified selections as they are and hit OK to load the graph.

    The following screenshot shows the first screen you will see once the graph has been loaded:

  4. To reposition the graph on the screen, place the mouse pointer somewhere on the Graph panel situated in the center of the screen and, while holding the right mouse button, move around to the location you want the graph to be centered at.

There are two ways in which the graph can be zoomed-in and zoomed-out:

  • Rotate the mouse wheel upwards to zoom-in and downwards to zoom-out with the mouse pointer located somewhere in the graph window.

  • Click on the upward-pointing arrow on the right-bottom corner of the graph window to expand the Settings panel. Click on the Global tab and use the zoom slider to zoom-in and zoom-out on the graph.

How it works…

Gephi has a pretty simple and user-friendly GUI. The upper-left corner on the screen has three tabs namely Overview, Data Laboratory, and Preview, which represent the three modes present in Gephi for network manipulation. You can customize which panels appear in the application by selecting/deselecting specific panels from the Window option in the menu bar.

The basics of working in the Overview mode


This recipe will take you through the basics of various functionalities available in Gephi's Overview mode.

Getting ready

Run Gephi and load a preexisting network. The first screen that you see is the Overview mode, which is otherwise called the Graph Manipulation mode in Gephi. If you already have Gephi running, clicking on the Overview tab in the upper-left corner of the screen will take you to this mode.

How to do it…

When in Overview mode, you'll able to perform a wide variety of manipulations on the graphs. These are categorized under the following subsections in the Overview mode, each located in a different part of the Overview screen:

  • Partition: This module lets you partition the graph into smaller components based on various node- and edge-specific properties, which are called partitioning parameters. One such example of partitioning parameters provided by Gephi is Modularity Class. The following screenshot shows the graph obtained after partitioning the Les Misérables graph on the basis of Modularity Class and then recoloring it:

  • Ranking: This module lets you rank the nodes of the graph based on various criteria such as degree, modularity class, edge weight, and so on. The following screenshot shows the Les Misérables network after its nodes have been ranked, according to their degrees:

  • Layout: In this module, one can obtain different visualizations of the same graph by using numerous graph layout algorithms that are provided in Gephi. Some of the most popularly used graph layout algorithms used in Gephi are Force Atlas, Fruchterman Reingold, and Yifan Hu. One such example is shown in the following screenshot, in which the Fruchterman Reingold layout algorithm has been applied to the Les Misérables graph:

  • Graph: In this panel, you'll find a list of basic tools that you can use to perform basic manipulations on the graph such as resizing individual nodes, coloring components of the graph, coloring individual nodes, and modifying node labels. If you do not see this panel on your screen, click on Window in the menu bar and select Graph from there.

  • Context: This part of the Overview screen gives information about the basic properties of the graph such as the number of edges, the number of nodes, and the type of graph.

  • Statistics: In this panel, one can run various statistical metrics on the graph to get a deeper insight into the network structure and network properties. In order to get any of the metrics for the graph, simply hit Run for a specific metric. This will generate an HTML report, which depicts that metric for the graph. One such report for degree distribution of the Les Misérables graph is shown in the following screenshot:

  • Filter: This part of the Overview screen contains various filtering parameters that are based on which of the nodes and edges of the graph could be filtered. One can combine multiple filtering parameters by using the logical operators present in the panel. The following screenshot shows the result of applying the k-core topology filter on the Les Misérables graph with the k value being 5:

See also

  • Chapter 3, Using Graph Layout Algorithms, to understand more about various graph layout algorithms present in Gephi.

  • Chapter 4, Working with Partition and Ranking Algorithms, to understand different ranking and partitioning approaches for graphs.

  • Chapter 5, Running Metrics, Filters, and Timelines, to know more about statistical metrics and filters for graphs. This chapter also explains concepts related to timeline controls for dynamic graphs.

  • http://en.wikipedia.org/wiki/Degeneracy_(graph_theory)#k-Cores to understand more about k-core topology in graphs

The basics of working in the Data Laboratory mode


This recipe introduces the Data Laboratory mode in Gephi, which allows users to manipulate network information represented in a tabular format.

Getting ready

Run Gephi and load the Les Misérables network.

How to do it…

To understand the basics of the Data Laboratory mode in Gephi, follow these steps:

  1. Click on the Data Laboratory tab, which is placed next to the Overview tab in the upper-left corner of the screen. You will see that all the information about the network can now be seen as a data table, as shown in the following screenshot, with columns or attributes such as nodes, node ID, and node label:

  2. Click on the Edges button, which is located right below the Overview tab in the upper-left corner of the view, to switch to viewing edge-specific details of the network. This is depicted in the following screenshot:

  3. In this mode, you can carry out tasks such as adding new columns, deleting columns, merging columns, and importing and exporting spreadsheets. Note that the columns here refer to the attributes of the edges.

See also

  • Chapter 6, Working in the Data Laboratory Mode, to learn more about the functionalities offered in the Data Laboratory mode in Gephi

The basics of working in the Preview mode


This recipe introduces the fundamentals of the Preview mode in Gephi. This mode lets you alter the way the final network will look. One can then export a snapshot of it into a required format such as a PDF or a PNG image file.

Getting ready

Run Gephi and load the Les Misérables network.

How to do it…

The following steps take you through the Preview mode in Gephi:

  1. Click on the Preview tab that is located in the upper-left side of the screen.

  2. You'll see the Default preset automatically selected. You can change the various properties of the graph in the panel according to how you would like to visualize the graph.

  3. Once you have entered the required properties, hit Refresh. This will generate the network in the default visualization; it could then be exported to the required file format by using the Export button present in the lower-left corner of the screen.

The following screenshot shows the Les Misérables network when visualized in the Default preview mode:

See also

  • Chapter 7, Getting Graphs and Networks Ready for Preview, to know more about the Preview mode in Gephi

Left arrow icon Right arrow icon

Key benefits

What you will learn

Install and configure Gephi on your system and understand its various features Perform basic manipulation and exploration tasks on graphs Understand various layout algorithms present by default in Gephi and the principles behind them Explore the properties of graphical networks using numerous filters and statistical metrics available in Gephi Import graph data from different sources and manipulate it directly in tabular formats Use realworld datasets to better understand network analysis

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : May 27, 2015
Length 296 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783987405
Concepts :

Table of Contents

18 Chapters
Gephi Cookbook Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
Acknowledgments Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
Getting Started with Gephi Chevron down icon Chevron up icon
Basic Graph Manipulations Chevron down icon Chevron up icon
Using Graph Layout Algorithms Chevron down icon Chevron up icon
Working with Partition and Ranking Algorithms Chevron down icon Chevron up icon
Running Metrics, Filters, and Timelines Chevron down icon Chevron up icon
Working in the Data Laboratory Mode Chevron down icon Chevron up icon
Getting Graphs and Networks Ready for Preview Chevron down icon Chevron up icon
Exploring Dynamic and Multilevel Graphs Chevron down icon Chevron up icon
Getting Real-world Graph Datasets Chevron down icon Chevron up icon
Exploring Some Useful Gephi Plugins Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.