Data visualization with R igraph package [closed] - r

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm doing a homework on data mining. Now I have a data set which stands for acquaintance network in social network. I want to visualize this network. In this network, vertex stands for user and edge stands for acquaintance relationship. Now I use igraph package for R to achieve my goal. However, my data set is too large with more than 100,000 vertexes and more than 1000,000 edges, which causes the generated graph not clear. In fact, the graph is totally unrecognized. How can I get a clear graph using igraph package? Or, which software can complete this task?
ps: my data set likes that:
100 20
10 2
2 4
each line stands for a relationship between two people
Thank you in advance!

In addition to Cytoscape, you might want to check out Gephi.
Another (quite different) approach to visualizing networks is by using hive plots -- worth checking out, too!

If you want an answer on this forum, you will need to provide at least a small amount of the data that you want to analyse and many people will help you get off to a good start.
You may also want to consider using an application, such as Cytoscape, that is designed for the analysis of networks. It may be easier to start your visualisation and exploration of this large network.

Related

Projection of points onto ellipsoid [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have a set of points (x0...xn, y0...yn, z0....zn) and an ellipsoid given by the equation: x^2/a^2 + y^2/b^2 + z^2/c^2 = 1. Is there an algorithm that could I use to project my points onto my ellipsoid? If so, what are the steps to accomplish this?
You also need a source point, the point that you are projecting from. Each point and the source point form a line, and you can find the intersection of that line and your ellipsoid. There will typically be either two or zero projection points, depending on whether the line intersects the ellipsoid or not. You might try solving the 2d case first to see if you understand it.
David Eberly's book on geometrical methods is usually a good source for such algorithms. You can get some insight from chapter 3 in this pdf. It is about point to ellipsoid distance evaluation but a lot of theory is the same.

generate D3 html pages with R? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would like to generate an interactive plot with R, for example an xyplot that shows information of the data points on mouseover, and I've read about D3. I would like to be able to write R code to generate the D3 html pages automatically. Is there any R package able to do that?
I've seen there is a r2d3 package on github but I am not sure how far that project is. Any ideas?
Looks to be fairly early in its development: https://github.com/hadley/r2d3. Hadley generally makes announcements when things are ready to test and then puts his packages on CRAN when they are ready for prime-time. (There's also confusion in that some versions of D3 on Github are named r2d3 when they have nothing to do with R): https://www.google.com/url?q=https://github.com/mhemesath/r2d3&sa=U&ei=Ig-YULraMueimQWxhYHgCA&ved=0CAwQFjAC&client=internal-uds-cse&usg=AFQjCNGe9p5iKH6deoHDpd2yKHJds8Qdow

How to perform Particle Swarm Optimization [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
We have been asked to do 5 or 6 iterations of particle swarm optimisation by hand for homework, but i don't really understand how and we were given no examples.
Would it be possible for someone to do the first run through for me so I can see how it works?
Explanations as each step would be fantastic.
Consider an illustrative example of a particle swarm optimisation system composed of three particles and Vmax = 10. To facilitate calculation, we will ignore the fact that r1 and r2 are random numbers and fix them to 0.5 for this exercise. The space of solutions is the two dimensional real valued space R2 and the current state of the swarm is as follows:
Position of particles: x1 = (5,5); x2 = (8,3); x3 = (6,7);
Individual best positions: x∗1 = (5,5); x∗2 = (7,3); x∗3 = (5,6);
Social best position: x∗ = (5,5);
Velocities: v1 = (2,2); v2 = (3,3); v3 = (4,4).
"I don't really understand how and we were given no examples". Let me add a little bit of critique to this sentence. If you're not given any examples it probably means you should be looking for examples for yourself. Have you even put "particle swarm optimization" into Google and look at some of the results? Do you expect everything in your study to be given to you?
There are many resources that explain the working of particle swarm optimization such as wikipedia, Google Scholar, Scholarpedia, or a dedicated website to PSO. The original paper is from Kennedy and Eberhart 1995 and is the top result in the scholar search. Also there are frameworks where PSO is implemented and where you can look at how it works like HeuristicLab. It's an opportunity to explore this topic.

Using matlab mex files with R [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I would want to use a certain function written in c for use with matlab, with the mex system.
Any ideas/experience about how to port this to R?
Since comments say this is to vague, some detail. There is a certain well-written matlab function I need for use with R (All the rest of my code are in R). This function have an empty
m-file, only documentation. All the work is in the corresponding .c-file, but this is c-code written specifically for use with matlab, so contains a lot of calls to mx-functions, which I understand are hooks into the inner life of matlab.
The suggestion to communicate via data files will not work, I need this function within an iterative algorithm.
This pdf file might give you some tips. I don't have any experience with using C with R, but it seems possible.
One method not mentioned in the file, which I like to use sometimes, is to simply use your MATLAB/R program to write out a text file of numbers to be input into your C program (e.g. c_data.dat), and then to use a system command to call a standalone C program which processes the data file, before spewing out some output numbers (e.g. c_output.dat). Then get your MATLAB/R program to read in the data from the file.
In MATLAB, this might look like this:
%# custom function to write to file
function_write_data( my_data_matrix, 'c_data.dat');
%# call the c program
system('./c_program c_data.dat c_output.dat');
%# read the results
my_results_matrix = function_read_data('c_output.dat');
(I'm not confident about the R syntax - you'll have to work that out for yourself!)
The advantage of this in your scenario is that you could use exactly the same C program for both R and MATLAB. You have to write the read/write functions though, and for some scenarios the read/write overheads could be prohibitive (i.e not give any noticeable increase in speed)..

algorithm to check whether a given graph is subgraph of another graph [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
i assume that we have 2 labeled graphs G and T and the algorithm determine if G a subgraph of T and the corresponding vertices in the main graphT and the subgraph G should have same label
That problem is called "subgraph isomorphism" and it is NP-complete (and so likely to be hard). Do you need a general solution for this, or just for a particular graph G? The second case is much easier. There is some general information about algorithms here. There is a version of one of the algorithms (actually, for a more general problem) in the Boost Graph Library (see documentation here).
A general answer for a general question: the problem you want to solve is known as 'subgraph isomorphism.' Have a look here for further references: http://en.wikipedia.org/wiki/Subgraph_isomorphism_problem .

Resources