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

$15.99 per month
Book May 2015 296 pages 1st Edition
eBook
$39.99 $27.98
Print
$48.99
Subscription
$15.99 Monthly
eBook
$39.99 $27.98
Print
$48.99
Subscription
$15.99 Monthly

What do you get with a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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 a Packt Subscription?

Free for first 7 days. $15.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.