Giter Club home page Giter Club logo

Comments (3)

clhunsen avatar clhunsen commented on August 21, 2024

I talked to @ecklbarb about the construction of multi-edge-type networks, e.g., supporting several author.relation entries in the network configuration. We came up with a solution that, as we hope, will add solutions for the following problems in the end: multi-edge-type networks, combination of networks, and, therefore, multi-artifact networks (see #15).

Multi-edge-type networks

To support a network-configuration entry such as author.relation = c("mail", "cochange"), we need to carry out the following steps:

  1. Change the allowed number of arguments for the author.relation key to Inf here:
    https://github.com/se-passau/codeface-extraction-r/blob/0e90d6152c854766ec0f40496745508cf0e228fa/util-conf.R#L651-L656

  2. Split the function construct.network.from.list into two parts here:

    1. The first part of the function is the construction of an edgelist and a set of vertices. From the new function, we need to return a list of the following shape which is compatible with igraph::as.data.frame():

      network.df = list(
          edges = edge.list,
          vertices = data.frame(name = nodes.processed)
      )

      This way, we can transform the list to a network easily, using the function igraph::graph.data.frame().

    2. The second part of the function is the reliable construction of a network from the returned list of edges and vertices. We need to be sure to include the corner-cases we handle right now.

  3. In the function get.author.network, we need to build the network by looping over all given author.relation entries given through the network configuration.
    https://github.com/se-passau/codeface-extraction-r/blob/0e90d6152c854766ec0f40496745508cf0e228fa/util-networks.R#L493-L536

    There, we need to perform following steps to ensure the construction of the right network:

    1. Get the edgelist and the set of vertices for all configured relations.
    2. Merge the edge lists and the sets of vertices. We should rely here on the function merge, which should provide all functionality we need for the join operation. We need a separate function for that.
    3. Call the new function from point 2.ii to construct a network from the merged edgelists and vertices.

Combination of networks

When we implement point 3.ii in a public function somewhere in the networks module (e.g., right next to add.edges.for.bipartite.relation or so), we have easy play for the combination of networks here: We just need to add a function with a similar signature that just takes two (or more) networks as parameters and then performs the following steps:

  1. Call igraph::as.data.frame() to obtain lists as described in point 2.i above.
  2. Merge the result using the function from 3.ii.
  3. Call the function from point 2.ii above.

Multi-artifact networks

As the combination of networks also works for differing artifacts, we are safe here.

Transfer for other types of networks

These steps need to be performed also for artifact networks (solving the main idea from #15 this way), bipartite networks, and multi networks. We have to be careful with the bipartite relation especially.

from coronet.

ecklbarb avatar ecklbarb commented on August 21, 2024

We have to remember to adapt the simplify function to the multi-edge-type networks. Each edge type should be left after the simplification.

from coronet.

clhunsen avatar clhunsen commented on August 21, 2024

I suggest that we add the further improvements in another issue (i.e., merging of edge lists instead of networks here and here; and simplification on edge lists instead of networks here) and close this issue after merging of PR #115 for better bookkeeping.

from coronet.

Related Issues (20)

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.