<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Graph Visualization of the Characteristics of Complex Objects on the Example of the Analysis of Politicians*</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Plekhanov Russian University of Economics</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stremyannyy per.</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Moscow</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Russia mulizko@kaf</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>.ru eantonov@kaf</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>.ru rrtukumbetova@kaf</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>National Research Nuclear University MEPhI (Moscow Engineering Physics Institute)</institution>
          ,
          <addr-line>Kashira Hwy, 31, 115409 Moscow</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>1976</year>
      </pub-date>
      <fpage>0000</fpage>
      <lpage>0003</lpage>
      <abstract>
        <p>The paper considers the task of analyzing complex interconnected objects using graph construction. There is no unified tool for constructing graphs. Some solutions can build graphs limited by the number of nodes, while others do not visually display data. The Gephi application was used to construct graphs for the research. Gephi has great functionality for building and analyzing graphs. The subject of research is a politician with a certain set of characteristics. In the paper an algorithm that enables to automate data collection on politicians was developed. One of the main methods of data collecting on the Internet is web scraping. Web scraping software may access the World Wide Web directly using the HTTP, or through a web browser. While web scraping can be done manually by a software user, the term typically refers to automated processes implemented using a software agent. The data was necessary for constructing graphs and their analysis. The use of graphs enables to see various types of relationships, including mediate. This methodology enables to change the attitude towards the analysis of multidimensional objects.</p>
      </abstract>
      <kwd-group>
        <kwd>Web Development</kwd>
        <kwd>Graph</kwd>
        <kwd>Visualization</kwd>
        <kwd>Politicians</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Data collection and processing</title>
      <p>
        In the modern world there is a large amount of information that can be represented in
the form of objects and the relationship between them. For example, objects can be
ыindividuals, the relationship between which is described by a certain characteristic. In
this case, graphs are often used for analysis [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>Political forces often play an important role for the development of scientific and
social activities within individual states and the world community. Decisions made by
political forces may depend on the individual characteristics of the person (gender, age,
fraction) and the relationship between each other.</p>
      <p>Information about political figures is also posted on the Internet. It enables to obtain
data in sufficient quantities. It is unreasonable to collect data on politicians manually,
since there is a lot of information. Therefore, algorithms are being developed that
enable to collect data from information sources of the Internet.</p>
      <p>To build graphs for political leaders, it is necessary to determine the nodes of the
graphs and describe the relationship between them.</p>
      <p>
        Graph plotting is an unnatural process for the computer. With existing software it is
rarely possible to construct large graphs or have the ability to interact. However, with
the correct construction, the graphs enables a qualitative data analysis and identify both
explicit and hidden relationships [
        <xref ref-type="bibr" rid="ref2 ref3 ref4">2-4</xref>
        ].
2
2.1
      </p>
    </sec>
    <sec id="sec-2">
      <title>Methodology</title>
      <sec id="sec-2-1">
        <title>Collecting data about policies on the Internet</title>
        <p>One of the main methods of data collecting on the Internet is web scraping. The general
principle of web scraping can be represented as follows: the program code sends a
request to the target source and receives a response in the form of HTML code, after
which it searches for the required information using the XPath query language.</p>
        <p>Requests are most often generated using the HTTP protocol; they use the GET
request method to receive data.</p>
        <p>The response is an object that is predisposed to receive any data. In data processing,
an HTML document is extracted from the response, after which a search is performed,
and the result is converted to the required format. This process is called parsing.</p>
        <p>Web scraping can be done in two ways:
• development of software;
• use of third-party software (including API).</p>
        <p>
          If it is necessary to use several information sources at the same time for data
extraction, the second method is usually not used. Automate data collection during the
development of software can be through the use of agent technologies (software agents)
[
          <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
          ]. Software agent is a computer program that acts on behalf of a user on demand or
according to a schedule. Additional software packages can be also used to interact with
the browser. When developing software to solve this problem, the programming
languages Python and JavaScript are most often used.
        </p>
        <p>
          Information about politicians is available on various Internet sources. As an
example, information from such sources as VoteSmart and Govtrack is considered [
          <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
          ].
They have a complex structure, so it is impossible to use third-party software. For the
development, we used the Python programming language and software packages of the
language, such as selenium, lxml.
        </p>
        <p>Graph Visualization of the Characteristics of Complex Objects… 3</p>
        <sec id="sec-2-1-1">
          <title>The data collection algorithm is divided into three subtasks:</title>
          <p>• GET request to an information source;
• extracting data from the response body (HTML document) using Xpath;
• saving the received data with the possibility of visualization.</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>Thus, the algorithm is as follows (see Fig. 1).</title>
          <p>
            JSON is selected as the data presentation format. The choice is due to the complex
nested structure of the raw data, which is difficult to process when stored in CSV
format. Meanwhile, the XML format is redundant [
            <xref ref-type="bibr" rid="ref9">9</xref>
            ].
2.2
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Graph representation of personality</title>
        <p>For the analysis of interrelated objects graphical representation of the data are used. A
graph consists of vertices (nodes) and edges that form a connection between vertices.
In order to determine the nodes and edges, we select the characteristics of the person
obtained during data collection:</p>
        <p>The figure (see Fig. 2) shows an example of the data collected by a politician in json.
Due to the fact that a person is characterized by many characteristics, when constructing
a graph for politicians, two approaches arise:
• the node of the graph is a person, an edge - some of the properties;
• several types of nodes of a person are selected, edges - the correspondence of nodes
in the raw data.</p>
        <p>
          In the first approach, for the trivial case, nodes [
          <xref ref-type="bibr" rid="ref7 ref8">7, 8</xref>
          ] can be connected by an edge
of the same type (for example, by belonging to the same party). In this case, between
the nodes either there is or there is no a node. The approach can be expanded by
introducing edges for each of the considered properties and introducing markers (color,
weight) to distinguish between the edges. For clarity, the different types of edges should
be no more than 5.
        </p>
        <p>For the second approach, the nodes are unique values of characteristics; edges are
the relationship between these characteristics in the raw data. To construct such a graph,
it is required to consider in what form the information is presented.</p>
        <p>The raw data are separate JSON files, which contain information about
representatives of some of the largest US states: Texas, California and Florida. To construct a
graph it is necessary to explicitly distinguish nodes and edges. We divide the nodes into
categories, while all nodes can be connected by edges only through the node identity.</p>
        <p>In the typical case a graph is defined by an adjacency matrix, but other methods are
often used. In particular, if there are many “zeros” in the adjacency matrix, which
indicate that there is no connection between nodes, the graph is specified with a list. The
list consists of entries of the following form (1):</p>
        <p>&lt;   ,   ,   , &gt;, where
  − starting node,   − end node,   . − edge weight
(1)</p>
        <p>Graph Visualization of the Characteristics of Complex Objects… 5
In this case the graph will be undirected. The edge only indicates the connection
between the nodes, not the nature of the connection. We distinguish the following
categories of nodes:
• Person;
• University;
• Religion;
• Membership in a civil organization;
• Party.</p>
        <p>Because of the initial data representation one of the nodes of each edge will be a
‘person’ node.</p>
        <p>The graph may be weighted and unweighted. Weight can be introduced if there is a
one-to-many relationship between objects. In particular, such a relationship is formed
in such node as ‘person – university’ and “person - membership in a civil organization”.
In this case, the weight of the edge will be specified and show the relative share of the
university / organization for a particular person. Mathematically this is given by a
formula (2):
∑ 
 =1   , = 1 
∀ ,  ℎ
(2)
 − "person" vertex,  − institutions connected with vertex j
The Python programming language is used to obtain the graph structure. The
developed algorithm converts the raw JSON data into nodes and edges, which are
stored in separate CSV files.
2.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Visualization and analysis</title>
        <p>
          There is no unified tool for constructing graphs. Some solutions can build graphs
limited by the number of nodes, while others do not visually display data [
          <xref ref-type="bibr" rid="ref10 ref11">10, 11</xref>
          ]. One
commonly used application is Gephi [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
        </p>
        <p>Gephi has great functionality for building and analyzing graphs. To build a graph we
want to colorize the nodes depending on the type of a characteristic. For drawing
graphs, several algorithms are proposed, we choose Force Atlas. The algorithm is based
on minimizing energy (the nodes are iteratively attracted or repelled from each other in
the visualization space, depending on their relative position and the presence of
connections), which allows graphs to be constructed with a high degree of interaction. First
we colorize the nodes according to the type of a considered characteristic.</p>
        <p>We construct a graph for the raw data by adjusting the display of output. The
resulting graph will have the following form (see Fig. 3).
In the figure, the size of a vertex is directly related l to the number of edges adjacent to
it, and the thickness of an edge is directly related to its weight. The following colors are
used in the figure:
• purple – organization;
• brown – party;
• yellow – religion;
• blue – university;
• red – a politician from the state of Florida;
• green – a politician from the state of Texas;
• blue – a politician from the state of California;</p>
        <p>Due to the layout method, the graphs were divided into two clusters: Democrats and
Republicans, but due to the large number of nodes, the data cannot be analyzed in detail.</p>
        <p>Filters can be used to refine the information. For example, the following filtering
result will show which university representatives of the states most often graduate from.
(see Fig. 4).</p>
        <p>Graph Visualization of the Characteristics of Complex Objects… 7
You can also view information about the relationship of an individual object or group
of objects. The figure shows the links between the «Henry Cuellar» and «Darren
Soto» nodes (see Fig. 5).
These persons are close to each other and it can be assumed that their views are similar.
As we can see from the graph, despite the fact that they are from different states, they
have a connection with the same organizations. Both are Catholic by religion and
belong to the Democratic Party.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>The task of visualizing linked multidimensional objects is relevant in the field of data
analysis. The described technology offers a working approach to constructing graphs
for an object such as a politician.</p>
      <p>The division of one object of an entity of different nature allows you to build
relationships between objects, to draw certain conclusions about them. In particular, the
most graduating educational institution is the University of California, graduates of this
university become democrats. The construction of several graphs allows us to analyze
in more detail and find internal relationships.</p>
      <p>It seems that for the sake of completeness, it is necessary to supplement the data for
all US congressmen, which truth will lead to a significant increase in relations and the
need to consider the graph to solve practical problems, whether it be an analysis of
educational institutions or lobbying organizations, or religions depending on the states,
etc.</p>
      <p>The use of such graph models seems extremely promising from the point of view of
analyzing a large amount of information not only on such a complex object as a person,
but also on organization technology, etc.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Kulik</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shtanko</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Using convolutional neural networks for recognition of objects varied in appearance in computer vision for intellectual robots</article-title>
          .
          <source>Procedia Computer Science</source>
          <volume>169</volume>
          ,
          <fpage>164</fpage>
          -
          <lpage>167</lpage>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Onykiy</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Artamonov</surname>
            ,
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tretyakov</surname>
            ,
            <given-names>E.S.</given-names>
          </string-name>
          <string-name>
            <surname>Ionkina</surname>
            ,
            <given-names>K.V.</given-names>
          </string-name>
          :
          <article-title>Visualization of large samples of unstructured information on the basis of specialized thesauruses</article-title>
          .
          <source>Scientific Visualization</source>
          <volume>9</volume>
          (
          <issue>5</issue>
          ),
          <fpage>54</fpage>
          -
          <lpage>58</lpage>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Tretyakov</surname>
            ,
            <given-names>E.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tukumbetova</surname>
            ,
            <given-names>R.R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Artamonov</surname>
            ,
            <given-names>A.A.</given-names>
          </string-name>
          :
          <article-title>Methodology of Analysis of Similar Objects with the Use of Modern Visualization Tools</article-title>
          .
          <source>Mechanisms and Machine Science</source>
          <volume>80</volume>
          ,
          <fpage>113</fpage>
          -
          <lpage>119</lpage>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Artamonov</surname>
            ,
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leonov</surname>
            ,
            <given-names>D.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nikolaev</surname>
            ,
            <given-names>V.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Onykiy</surname>
            ,
            <given-names>B.N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pronicheva</surname>
            ,
            <given-names>L.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sokolina</surname>
            ,
            <given-names>K.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ushmarov</surname>
            ,
            <given-names>I.A.</given-names>
          </string-name>
          :
          <article-title>Visualization of semantic relations in multi-agent systems</article-title>
          .
          <source>Scientific Visualization</source>
          ,
          <volume>6</volume>
          (
          <issue>3</issue>
          ),
          <fpage>68</fpage>
          -
          <lpage>76</lpage>
          (
          <year>2014</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Kulik</surname>
            ,
            <given-names>S.D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Shtanko</surname>
            ,
            <given-names>A.N.</given-names>
          </string-name>
          :
          <article-title>Experiments with Neural Net Object Detection System YOLO on Small Training Datasets for Intelligent Robotics</article-title>
          .
          <source>Mechanisms and Machine Science</source>
          <volume>80</volume>
          ,
          <fpage>157</fpage>
          -
          <lpage>162</lpage>
          (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Kulik</surname>
          </string-name>
          , S.D.:
          <article-title>Neural network model of artificial intelligence for handwriting recognition</article-title>
          .
          <source>Journal of Theoretical and Applied Information Technology</source>
          <volume>73</volume>
          (
          <issue>2</issue>
          ),
          <fpage>202</fpage>
          -
          <lpage>211</lpage>
          (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7. Votesmart, https://justfacts.votesmart.org,
          <source>last accessed</source>
          <year>2020</year>
          /06/10.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. Govtrack, https://www.govtrack.us,
          <source>last accessed</source>
          <year>2020</year>
          /06/10.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Grigorieva</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aulov</surname>
            ,
            <given-names>V.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Golosova</surname>
            ,
            <given-names>M.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gubin</surname>
            ,
            <given-names>M.Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimentov</surname>
            ,
            <given-names>A.A.</given-names>
          </string-name>
          :
          <article-title>Data knowledge base prototype for modern scientific collaborations</article-title>
          .
          <source>In: Selected Papers of the 7th International Conference Distributed Computing and Grid-technologies in Science and Education</source>
          , pp.
          <fpage>26</fpage>
          -
          <lpage>33</lpage>
          . CEUR,
          <string-name>
            <surname>Dubna</surname>
          </string-name>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Galkin</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Popov</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pilyugin</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grigorieva</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>The visualization method pipeline for the application to dynamic data analysis</article-title>
          .
          <source>In: Proceedings of the 27th Symposium on Nuclear Electronics and Computing</source>
          , pp.
          <fpage>295</fpage>
          -
          <lpage>299</lpage>
          . CEUR,
          <string-name>
            <surname>Budva</surname>
          </string-name>
          (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Galkin</surname>
            ,
            <given-names>T.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grigorieva</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Klimentov</surname>
            ,
            <given-names>A.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Korchuganova</surname>
            ,
            <given-names>T.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milman</surname>
            ,
            <given-names>I.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pilyugin</surname>
            ,
            <given-names>V.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Titov</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          :
          <article-title>Visual cluster analysis for computing tasks at workflow management system of the ATLAS experiment at the LHC</article-title>
          .
          <source>In: GraphiCon 2018 - 28th International Conference on Computer Graphics and Vision</source>
          , pp.
          <fpage>111</fpage>
          -
          <lpage>114</lpage>
          . GraphiCon Scientific Society, Tomsk (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Gephi</surname>
          </string-name>
          , https://gephi.org,
          <source>last accessed</source>
          <year>2020</year>
          /06/28.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>