Comments (4)
If we assume that there is a link between the two papers and the link is no
greater than N (lets say N = 3), we can hard code it in the query itself.
given:
from paper id = fpid
to paper id = tpid
Aassuming the reference table as: reference(pid:int, refid:int)
For degree two (N = 2), we will have :
select B.pid from
reference A, reference B *
*where A.refid = B.pid and A.pid = fpid and B.refid = tpid
We can extend it to N = 3, and higher
Will that approach work?
Viru
On Fri, Sep 14, 2012 at 1:48 PM, Christan Grant [email protected]:
Here is a problem for you @virup https://github.com/virup @clintpgeorgehttps://github.com/clintpgeorge
@supriyan https://github.com/supriyan,Given two papers how would you write a db query to find the "shortest"
path between them.Vertices are papers and edges and citations/references. We can think of
the edges as being undirected. It is certainly possible that no path exists
between two papers.Can you implement a solution to this?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17.
from grisham.
Hard coding will not give you full credit lol.
...Let's say you are using Postgres 9.1
On Friday, September 14, 2012, Viru Kanjilal wrote:
If we assume that there is a link between the two papers and the link is
no greater than N (lets say N = 3), we can hard code it in the query itself.given:
from paper id = fpid
to paper id = tpidAassuming the reference table as: reference(pid:int, refid:int)
For degree two (N = 2), we will have :
select B.pid from
reference A, reference B
where A.refid = B.pid and A.pid = fpid and B.refid = tpidWe can extend it to N = 3, and higher
Will that approach work?
Viru
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-8570100.
Christan Grant
<><
from grisham.
Why is it important to have a SQL query for this? If the data is available
in the database, cant we employ an algorithm to get the shortest path?
That algorithm may make use of SQL queries.
-Sup
On Fri, Sep 14, 2012 at 2:01 PM, Christan Grant [email protected]:
Hard coding will not give you full credit lol.
...Let's say you are using Postgres 9.1
On Friday, September 14, 2012, Viru Kanjilal wrote:
If we assume that there is a link between the two papers and the link is
no greater than N (lets say N = 3), we can hard code it in the query
itself.given:
from paper id = fpid
to paper id = tpidAassuming the reference table as: reference(pid:int, refid:int)
For degree two (N = 2), we will have :
select B.pid from
reference A, reference B
where A.refid = B.pid and A.pid = fpid and B.refid = tpidWe can extend it to N = 3, and higher
Will that approach work?
Viru
—
Reply to this email directly or view it on GitHub<
https://github.com/cegme/grisham/issues/17#issuecomment-8570100>.Christan Grant
<><—
Reply to this email directly or view it on GitHubhttps://github.com//issues/17#issuecomment-8570275.
Supriya Nirkhiwale
4337 NW 35th Terrace
Gainesville, FL 32605
USA
from grisham.
Hey the Issues is closed. Check out the solution @virup and I came up with here: https://gist.github.com/3725408
from grisham.
Related Issues (20)
- User save settings HOT 1
- User version control
- Microsoft Academic API integration HOT 2
- Use Lucene/solr for text search HOT 1
- Graph visualization meanings
- Bug in DB KL computation
- Visualize the paper data
- CitationRank (like PageRank accept for papers/citations) HOT 2
- SIAM DM 13 paper HOT 2
- Make website independent of location HOT 2
- NIPS paper topic visualization
- Technical Report HOT 2
- Database access using 32 cores HOT 1
- Move the current website to the dsr page
- PAssword protect the website
- Rewrite the Graph visualization code HOT 2
- Add user feedback to define topics
- Multiple topic exploration HOT 3
- Virtual topics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grisham.