Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8536253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:37:11+00:00 2026-06-11T10:37:11+00:00

Using in R the package ‘igraph’ and calling the function: graph <- graph.empty(10,directed=FALSE) write.graph(graph,some/path/graph.txt,format=edgelist)

  • 0

Using in R the package ‘igraph’ and calling the function:

graph <- graph.empty(10,directed=FALSE)
write.graph(graph,"some/path/graph.txt",format="edgelist")

If I recall the graph by using

g <- as.undirected(read.graph("some/path/graph.txt",format="edgelist"))

the graph is empty but has also NO vertices!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:37:12+00:00Added an answer on June 11, 2026 at 10:37 am

    An edgelist is a matrix with 2 columns with a row for each edge, first column indicating the source node and second column the node of destination. Since you have no edges the edgelist is empty and hence the file you write is empty.

    Usually the edgelist is the simplest way of storing a graph, and the number of nodes can be inferred from the number of unique node names in the edgelist (or highest integer if nodes are numbered, which I think is what igraph does), but it goes wrong if there are nodes with no edges,

    You can try another format that also stores information on the nodes. e.g.,

    library("igraph")
    
    graph <- graph.empty(10,directed=FALSE)
    write.graph(graph,"graph.txt",format="pajek")
    
    
    g <- as.undirected(read.graph("graph.txt",format="pajek"))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I am using subfig package in latex, it gives some errors: Package subfig
I'm usually using reshape package to aggregate some data (d'uh), usually with plyr ,
I am unable to install a package (using package restore) due to some kind
I'm calling a SSIS package using LoadPackage(...). Is it possible to make this call
Can I call a function or procedure by using package name, if they are
Hi I am using package-maker of Mac OS to create installer package for Mac
I am using caret package for R to select variables for my model. When
I'm using the package android.telephony.SmsManager to send an SMS message from within my application,
I am creating package using cmake I am having following structure bin/ bin1 lib/
I am creating an azure package using Visual Studio (right click on azure project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.